Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
 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))
Ejemplo n.º 3
0
 def test_link_global_to_local(self):
     sys.argv.append(
         self.test_name)  #Add the test_name value as the "module to link"
     kubos.main()
     with open(get_local_link_file(), 'r') as link_file:
         link_data = json.load(link_file)
     self.assertTrue(self.test_name in link_data[module_key])
Ejemplo n.º 4
0
 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))
Ejemplo n.º 5
0
 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))
Ejemplo n.º 6
0
 def test_link_relative_path(self):
     with open('module.json', 'w') as target_file:
         target_file.write(self.json_template)
     sys.argv.append(os.getcwd())
     kubos.main()
     with open(get_global_link_file(), 'r') as link_file:
         global_link_data = json.load(link_file)
     with open(get_local_link_file(), 'r') as link_file:
         local_link_data = json.load(link_file)
     self.assertTrue(self.test_name in global_link_data[module_key])
     self.assertTrue(self.test_name in local_link_data[module_key])