Example #1
0
    def test_import_non_existent_experiment(self):
        mlc = MLCLocal(working_dir=MLCWorkspaceTest.WORKSPACE_DIR)

        import_experiment_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                              "test4.mlc")
        mlc.import_experiment(import_experiment_path)
        self.assertTrue("test4" in mlc.get_workspace_experiments())
        mlc.delete_experiment("test4")
Example #2
0
 def test_import_experiment_with_erroneous_path(self):
     mlc = MLCLocal(working_dir=MLCWorkspaceTest.WORKSPACE_DIR)
     import_experiment_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                           "test5.mlc")
     try:
         mlc.import_experiment(import_experiment_path)
         self.assertTrue(False)
         mlc.delete_experiment("test5")
     except MLC.api.mlc.ImportExperimentPathNotExistException:
         self.assertTrue(True)
         self.assertFalse("test5" in mlc.get_workspace_experiments())
Example #3
0
    def test_import_existent_experiment(self):
        mlc = MLCLocal(working_dir=MLCWorkspaceTest.WORKSPACE_DIR)
        mlc.new_experiment("test4", MLCWorkspaceTest.ORIGINAL_CONFIGURATION)

        import_experiment_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                              "test4.mlc")
        try:
            mlc.import_experiment(import_experiment_path)
            self.assertTrue(False)
        except MLC.api.mlc.DuplicatedExperimentError:
            self.assertTrue(True)
        finally:
            mlc.delete_experiment("test4")