Skip to content

Commit 7d779b5

Browse files
committed
add get_invoices_summary schema json
1 parent a162fd0 commit 7d779b5

File tree

4 files changed

+33
-34
lines changed

4 files changed

+33
-34
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
1-
{}
1+
{
2+
"type": "object",
3+
"properties": {
4+
"startDate": {
5+
"type": "string",
6+
"description": "The format is YY-MM-DD"
7+
},
8+
"endDate": {
9+
"type": "string",
10+
"description": "The format is YY-MM-DD"
11+
},
12+
"extProjectId": {
13+
"type": "string"
14+
}
15+
},
16+
"required": []
17+
}

tests/test_invoices.py

+15
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,18 @@ def test_get_invoice(self):
2727
self.api.get_invoice(1337)
2828
self.assertEqual(len(responses.calls), 1)
2929
self.assertEqual(responses.calls[0].response.headers['content-type'], 'application/pdf')
30+
31+
@responses.activate
32+
def test_get_invoices_summary(self):
33+
with open('./tests/test_files/get_invoices_summary.pdf', 'rb') as summary_file:
34+
responses.add(
35+
responses.GET,
36+
'{}/sample/v1/projects/invoices/summary'.format(BASE_HOST),
37+
body=summary_file.read(),
38+
content_type='application/pdf',
39+
stream=True,
40+
status=200)
41+
42+
self.api.get_invoices_summary(startDate='2019-06-12', endDate='2019-06-19', extProjectId='010528ef-8984-48c1-a06d-4dae730da027')
43+
self.assertEqual(len(responses.calls), 1)
44+
self.assertEqual(responses.calls[0].response.headers['content-type'], 'application/pdf')

tests/test_invoices_summary.py

-32
This file was deleted.

tests/test_line_items.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from __future__ import unicode_literals, print_function
21
# encoding: utf-8
2+
from __future__ import unicode_literals, print_function
33

44
import json
55
import unittest

0 commit comments

Comments
 (0)