Skip to content

Commit c304f4b

Browse files
committed
[HOT-FIX] files hot fix: create tests;
1 parent 697932b commit c304f4b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/integration_test_data_objects.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# -*- coding: utf-8 -*-
22
from hashlib import md5
3-
from StringIO import StringIO
3+
4+
try:
5+
# python2
6+
from StringIO import StringIO
7+
except ImportError:
8+
# python3
9+
from io import StringIO
410

511
import requests
612
from syncano.models import Object
@@ -101,6 +107,7 @@ def test_manager_create(self):
101107
create_string = 'manager create'
102108
with open(self.file_path, 'rb') as f:
103109
data_object = Object.please.create(
110+
class_name=self.class_name,
104111
test_field_a=create_string,
105112
test_field_file=f
106113
)
@@ -120,7 +127,8 @@ def assert_file_md5(self, data_object):
120127
def _create_object_with_file(self):
121128
with open('tests/test_files/python-logo.png', 'rb') as f:
122129
object = Object.please.create(
130+
class_name=self.class_name,
123131
test_field_a=self.initial_field_a,
124-
test_field_file=f
132+
test_field_file=f,
125133
)
126134
return object

0 commit comments

Comments
 (0)