def test_remove_linked_module(self): local_link_file = get_local_link_file() set_link(local_link_file, module_key, self.test_name) self.assertTrue(check_link(local_link_file, module_key, self.test_name)) sys.argv.append(self.test_name) kubos.main() self.assertFalse(check_link(local_link_file, module_key, self.test_name))
def test_link_target_relative_path(self): with open('target.json', 'w') as target_file: target_file.write(self.json_template) sys.argv.append(os.getcwd()) kubos.main() self.assertTrue(check_link(get_global_link_file(), target_key, self.test_name)) self.assertTrue(check_link(get_local_link_file(), target_key, self.test_name))
def test_check_link(self): with open(self.json_file, 'w') as json_file: json_file.write(json.dumps(self.test_data)) #Verify element in the file is True self.assertTrue(check_link(self.json_file, module_key, self.test_key)) #Verify element not in the file is False self.assertFalse(check_link(self.json_file, module_key, None))
def test_link_target_relative_path(self): with open('target.json', 'w') as target_file: target_file.write(self.json_template) sys.argv.append(os.getcwd()) kubos.main() self.assertTrue( check_link(get_global_link_file(), target_key, self.test_name)) self.assertTrue( check_link(get_local_link_file(), target_key, self.test_name))
def test_remove_linked_module(self): local_link_file = get_local_link_file() set_link(local_link_file, module_key, self.test_name) self.assertTrue(check_link(local_link_file, module_key, self.test_name)) sys.argv.append(self.test_name) kubos.main() self.assertFalse( check_link(local_link_file, module_key, self.test_name))
def test_link_target_global_to_local(self): sys.argv.append(self.test_name) kubos.main() self.assertTrue( check_link(get_global_link_file(), target_key, self.test_name)) remove_link(get_global_link_file(), target_key, self.test_name)
def test_link_target_global(self): with open('target.json', 'w') as target_file: target_file.write(self.json_template) kubos.main() self.assertTrue( check_link(get_global_link_file(), target_key, self.test_name))
def test_link_target_global_to_local(self): sys.argv.append(self.test_name) kubos.main() self.assertTrue(check_link(get_global_link_file(), target_key, self.test_name)) remove_link(get_global_link_file(), target_key, self.test_name)
def test_link_target_global(self): with open('target.json', 'w') as target_file: target_file.write(self.json_template) kubos.main() self.assertTrue(check_link(get_global_link_file(), target_key, self.test_name))