コード例 #1
0
ファイル: test_remove.py プロジェクト: kyleparrott/kubos-sdk
 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))
コード例 #2
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))
コード例 #3
0
ファイル: test_utils.py プロジェクト: kyleparrott/kubos-sdk
 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))
コード例 #4
0
 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))
コード例 #5
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))
コード例 #6
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))
コード例 #7
0
 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)
コード例 #8
0
 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))
コード例 #9
0
 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)
コード例 #10
0
 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))