Beispiel #1
0
    def test_get_local_host_tests_dir_default_path(self):
        import os
        import shutil
        import tempfile

        curr_dir = os.getcwd()
        test1_dir = tempfile.mkdtemp()
        test2_dir = os.mkdir(os.path.join(test1_dir, "test"))
        test3_dir = os.mkdir(os.path.join(test1_dir, "test", "host_tests"))

        os.chdir(test1_dir)

        test_path = mbed_greentea_cli.get_local_host_tests_dir("")
        self.assertEqual(test_path, "./test/host_tests")

        os.chdir(curr_dir)
        shutil.rmtree(test1_dir)
Beispiel #2
0
 def test_get_local_host_tests_dir_valid_path(self):
     path = "."
     test_path = mbed_greentea_cli.get_local_host_tests_dir(path)
     self.assertEqual(test_path, path)
Beispiel #3
0
 def test_get_local_host_tests_dir_invalid_path(self):
     test_path = mbed_greentea_cli.get_local_host_tests_dir("invalid-path")
     self.assertEqual(test_path, None)