Skip to content

Commit 8ae50d5

Browse files
authored
Merge pull request #72 from sendwithus/update-tests-for-i18n-upload
Update tests for i18n upload
2 parents 7586b59 + cc7910b commit 8ae50d5

7 files changed

Lines changed: 37 additions & 14 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ matrix:
88
- python: 2.7
99
env:
1010
- TOXENV='py27'
11-
- python: 3.3
11+
- python: 3.4
1212
env:
13-
- TOXENV='py33'
13+
- TOXENV='py34'
1414
- python: 3.5
1515
env:
1616
- TOXENV='py35'

CHANGES.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ def email_id():
2222
return 'test_fixture_1'
2323

2424

25+
@pytest.fixture
26+
def translation_template_id():
27+
return 'test_translation_fixture_1'
28+
29+
2530
@pytest.fixture
2631
def email_address():
2732
return 'person@example.com'
@@ -85,3 +90,13 @@ def bcc_test():
8590
'address': 'test+bcc@sendwithus.com'
8691
}
8792
]
93+
94+
95+
@pytest.fixture
96+
def translation_file_test():
97+
return './fixtures/translations.zip'
98+
99+
100+
@pytest.fixture
101+
def translation_tag_test():
102+
return 'translate'

fixtures/translations.zip

562 Bytes
Binary file not shown.

sendwithus/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = '5.0.0'
1+
version = '5.1.0'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name='sendwithus',
9-
version='5.0.0',
9+
version='5.1.0',
1010
author='sendwithus',
1111
author_email='us@sendwithus.com',
1212
packages=find_packages(),

test_base.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,21 @@ def test_raise_errors_option(api_key, api_options):
550550
)
551551

552552
assert 400 == response.status_code
553+
554+
555+
def test_translation_upload(api, translation_tag_test, translation_file_test):
556+
with open(translation_file_test, 'rb') as f:
557+
response = api.create_translation_file(
558+
translation_tag_test,
559+
f.read()
560+
)
561+
562+
assert_success(response)
563+
564+
565+
def test_translation_get(api, translation_tag_test, translation_file_test):
566+
response = api.get_translation_template(
567+
translation_tag_test
568+
)
569+
570+
assert 200 == response.status_code

0 commit comments

Comments
 (0)