def test_rmdir(self): folder = Path('.').join('trackit_testing_path') folder.makedir() assert folder.exists() foo = folder.join('foo') with foo.open('w') as out: out.write('foo') assert foo.exists() folder.rmdir() assert not folder.exists()
# # This file is a part of trackit. It is distributed under the terms # of the modified BSD license. The full license is available in # LICENSE, distributed as part of this software. import os from cStringIO import StringIO from trackit.util import Path from trackit.configuration import ( DEFAULT, load_user_settings, dump_settings, load_settings, create_home, load_system_settings, load_configuration ) target = Path('trackit_test_configuration') config = target.join('config') def teardown_function(func): if target.exists(): target.rmdir() def test_settings_encoder(): file_ = StringIO() dump_settings(DEFAULT, file_) assert file_.getvalue() def test_default_config_should_have_all_keys(): assert 'database' in DEFAULT assert 'encoding' in DEFAULT def test_dumping_settings_should_result_in_json_parsable_file():