Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package and modify the tests #117

Merged
merged 1 commit into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ httplib2
futures; python_version < '3.0'
gevent
prettytable
pytest
pytest
pytz
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ django-import-export
future
six
httplib2
futures; python_version < '3.0'
futures; python_version < '3.0'
pytz
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
url='https://github.com/vesoft-inc/nebula-python',
install_requires=['httplib2',
'future',
'six'],
'six',
'pytz'],
packages=find_packages(),
platforms=["3.5, 3.7"],
package_dir={'nebula2': 'nebula2'},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data_from_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def setUpClass(cls) -> None:
cls.session = cls.pool.get_session('root', 'nebula')
resp = cls.session.execute(
'''
CREATE SPACE IF NOT EXISTS test_data;
CREATE SPACE IF NOT EXISTS test_data(vid_type=FIXED_STRING(8));
USE test_data;
CREATE TAG IF NOT EXISTS person(name string, age int8, grade int16,
friends int32, book_num int64, birthday datetime,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_meta_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def setup_class(cls):
session_id = auth_result.get_session_id()
assert session_id != 0
resp = conn.execute(session_id,
'CREATE SPACE IF NOT EXISTS test_meta_cache1(REPLICA_FACTOR=3);'
'CREATE SPACE IF NOT EXISTS test_meta_cache1(REPLICA_FACTOR=3, vid_type=FIXED_STRING(8));'
'USE test_meta_cache1;'
'CREATE TAG IF NOT EXISTS tag11(name string);'
'CREATE EDGE IF NOT EXISTS edge11(name string);'
'CREATE SPACE IF NOT EXISTS test_meta_cache2;'
'CREATE SPACE IF NOT EXISTS test_meta_cache2(vid_type=FIXED_STRING(8));'
'USE test_meta_cache2;'
'CREATE TAG IF NOT EXISTS tag22(name string);'
'CREATE EDGE IF NOT EXISTS edge22(name string);')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def main_test():
space_name = 'space_' + threading.current_thread().getName()

session.execute('DROP SPACE %s' % space_name)
resp = session.execute('CREATE SPACE IF NOT EXISTS %s' % space_name)
resp = session.execute('CREATE SPACE IF NOT EXISTS %s(vid_type=FIXED_STRING(8))' % space_name)
if not resp.is_succeeded():
raise RuntimeError('CREATE SPACE failed: {}'.format(resp.error_msg()))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_local_session(pool):
def test_2_reconnect(self):
try:
session = self.pool.get_session('root', 'nebula')
session.execute('CREATE SPACE IF NOT EXISTS test_session; USE test_session;')
session.execute('CREATE SPACE IF NOT EXISTS test_session(vid_type=FIXED_STRING(8)); USE test_session;')
for i in range(0, 5):
if i == 3:
os.system('docker stop nebula-docker-compose_graphd0_1')
Expand Down