commit 53ab6eeb34a69755f0991ee6605bcb7414cdb081 Author: juga0 juga@riseup.net Date: Wed Jul 18 20:11:06 2018 +0000
Remove init --- tests/unit/core/test_init.py | 45 -------------------------------------------- 1 file changed, 45 deletions(-)
diff --git a/tests/unit/core/test_init.py b/tests/unit/core/test_init.py deleted file mode 100644 index 77f3b0a..0000000 --- a/tests/unit/core/test_init.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Unit tests for sbws.core.init.""" -import logging -import os.path - -import sbws - - -def test_sbwshome_only_datadir(sbwshome_only_datadir, args, conf, caplog): - caplog.set_level(logging.DEBUG) - sbws.core.init.main(args, conf) - print(caplog.records[-1].getMessage()) - assert "Creating {} based on example config".format( - os.path.join(conf['paths']['sbws_home'], 'config.ini')) \ - in caplog.records[-1].getMessage() - assert os.path.isdir(conf['paths']['sbws_home']) - assert os.path.isdir(conf['paths']['datadir']) - assert os.path.isfile(os.path.join(conf['paths']['sbws_home'], - 'config.ini')) - - -def test_sbwshome_empty(args, conf, caplog): - caplog.set_level(logging.DEBUG) - sbws.core.init.main(args, conf) - assert "Creating {} based on example config".format( - os.path.join(conf['paths']['sbws_home'], 'config.ini')) \ - in caplog.records[-1].getMessage() - assert os.path.isdir(conf['paths']['sbws_home']) - assert os.path.isfile(os.path.join(conf['paths']['sbws_home'], - 'config.ini')) - - -def test_sbwshome(sbwshome, args, conf, caplog): - caplog.set_level(logging.DEBUG) - try: - sbws.core.init.main(args, conf) - except SystemExit as e: - assert e.code == 1 - else: - assert None, 'Should have failed' - assert "Directory already seems to be initted" \ - in caplog.records[-1].getMessage() - assert os.path.isdir(conf['paths']['sbws_home']) - assert os.path.isdir(conf['paths']['datadir']) - assert os.path.isfile(os.path.join(conf['paths']['sbws_home'], - 'config.ini'))