def get_metadata(self):
        # get which platform agent is selected from the current metadata, use
        # this to get metadata from the cloned repo
        tmp_metadata = Metadata()
        log.debug("Current Metadata: %s", tmp_metadata.serialize())

        # read metadata from the cloned repo
        self.metadata = Metadata(tmp_metadata.driver_path,
                                 REPODIR + '/marine-integrations')
        log.debug("Result Metadata: %s", self.metadata.serialize())

        return self.metadata
    def test_constructor(self):
        """
        Test object creation
        """
        default_metadata = Metadata()
        self.assertTrue(default_metadata)

        specific_metadata = Metadata(DRIVER_PATH, BASE_DIR)
        self.assertTrue(specific_metadata)
        self.assertTrue(os.path.isfile(specific_metadata.metadata_path()),
                        msg="file doesn't exist: %s" %
                        specific_metadata.metadata_path())

        self.assertEqual(specific_metadata.driver_path, "test_driver/foo")
        self.assertEqual(specific_metadata.driver_name, "test_driver_foo")
        self.assertEqual(specific_metadata.author, "Bill French")
        self.assertEqual(specific_metadata.email, "*****@*****.**")
        self.assertEqual(specific_metadata.notes, "some note")
        self.assertEqual(specific_metadata.version, "0.2.2")
Beispiel #3
0
def get_metadata(opts):
    """
    return a list of metadata objects that we would like to
    run test for.  If buildall option is set then we search
    the working directory tree for drivers, otherwise we
    return the current IDK driver metadata
    @param opts: command line options dictionary.
    @return: list of all metadata data objects we would
             like to run tests for.
    """
    result = []
    if(opts.buildall):
        paths = get_driver_paths()
        for path in paths:
            log.debug("Adding driver path: %s", path)
            result.append(Metadata(path))
    else:
        result.append(Metadata())

    return result
Beispiel #4
0
 def overwrite(self):
     """
     @brief Overwrite the current files with what is stored in the current metadata file.
     """
     self.metadata = Metadata()
     self.generate_code(force = True)
Beispiel #5
0
 def fetch_metadata(self):
     """
     @brief collect metadata from the user
     """
     self.metadata = Metadata()
     self.metadata.get_from_console()
Beispiel #6
0
 def fetch_metadata(self):
     """
     @brief collect metadata from the user
     """
     self.metadata = Metadata()