Skip to content

Commit

Permalink
test: move unit/ to test/
Browse files Browse the repository at this point in the history
This virtually reverts commit 436218d
('move unit tests to unit'), that was made in the scope of #106.

Despite the fact that testing of the connector uses `unittest`
framework, it is functional (and integration) testing by its nature:
most of the test cases verify that public API of the connector properly
works with tarantool.

In seems meaningful to locate such kind of test cases in the `test/`
directory, not `unit/`, disregarding of used framework.

Follows up #106.
  • Loading branch information
Totktonada committed Feb 18, 2021
1 parent dccf18f commit ea942f9
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ On Linux:
On Windows:

* Setup a Linux machine with installed tarantool (called ``remote`` later).
* (on ``remote``) Copy ``unit/suites/lib/tarantool_python_ci.lua`` to
* (on ``remote``) Copy ``test/suites/lib/tarantool_python_ci.lua`` to
``/etc/tarantool/instances.available``.
* (on ``remote``) Run ``tarantoolctl start tarantool_python_ci``.
* Set the following environment variables:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# Test runner
# python setup.py test
try:
from unit.setup_command import test
from test.setup_command import test
cmdclass["test"] = test
except ImportError:
pass
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions unit/setup_command.py → test/setup_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class test(setuptools.Command):
user_options = []
description = 'Run unit tests'
description = 'Run tests'

def initialize_options(self):
pass
Expand All @@ -23,7 +23,7 @@ def run(self):
Find all tests in test/tarantool/ and run them
'''

tests = unittest.defaultTestLoader.discover('unit', pattern='suites')
tests = unittest.defaultTestLoader.discover('test', pattern='suites')
test_runner = unittest.TextTestRunner(verbosity=2)
result = test_runner.run(tests)
if not result.wasSuccessful():
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion unit/suites/test_dbapi.py → test/suites/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def setUpClass(self):
print(' DBAPI '.center(70, '='), file=sys.stderr)
print('-' * 70, file=sys.stderr)
self.srv = TarantoolServer()
self.srv.script = 'unit/suites/box.lua'
self.srv.script = 'test/suites/box.lua'
self.srv.start()
self.con = tarantool.Connection(self.srv.host, self.srv.args['primary'])
self.driver = dbapi
Expand Down
2 changes: 1 addition & 1 deletion unit/suites/test_dml.py → test/suites/test_dml.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def setUpClass(self):
print(' DML '.center(70, '='), file=sys.stderr)
print('-' * 70, file=sys.stderr)
self.srv = TarantoolServer()
self.srv.script = 'unit/suites/box.lua'
self.srv.script = 'test/suites/box.lua'
self.srv.start()
self.con = tarantool.Connection(self.srv.host, self.srv.args['primary'])
self.adm = self.srv.admin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def setUpClass(self):
print(' EXECUTE '.center(70, '='), file=sys.stderr)
print('-' * 70, file=sys.stderr)
self.srv = TarantoolServer()
self.srv.script = 'unit/suites/box.lua'
self.srv.script = 'test/suites/box.lua'
self.srv.start()
self.con = tarantool.Connection(self.srv.host, self.srv.args['primary'])

Expand Down
2 changes: 1 addition & 1 deletion unit/suites/test_mesh.py → test/suites/test_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def create_server(_id):
srv = TarantoolServer()
srv.script = 'unit/suites/box.lua'
srv.script = 'test/suites/box.lua'
srv.start()
srv.admin("box.schema.user.create('test', {password = 'test', " +
"if_not_exists = true})")
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setUpClass(self):
print(' RECONNECT '.center(70, '='), file=sys.stderr)
print('-' * 70, file=sys.stderr)
self.srv = TarantoolServer()
self.srv.script = 'unit/suites/box.lua'
self.srv.script = 'test/suites/box.lua'

def setUp(self):
# prevent a remote tarantool from clean our session
Expand Down
2 changes: 1 addition & 1 deletion unit/suites/test_schema.py → test/suites/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setUpClass(self):
print(' SCHEMA ({}) '.format(params).center(70, '='), file=sys.stderr)
print('-' * 70, file=sys.stderr)
self.srv = TarantoolServer()
self.srv.script = 'unit/suites/box.lua'
self.srv.script = 'test/suites/box.lua'
self.srv.start()
self.con = tarantool.Connection(self.srv.host, self.srv.args['primary'],
encoding=self.encoding)
Expand Down

0 comments on commit ea942f9

Please sign in to comment.