Пример #1
0
    def test_no_distribution(self, mock_get_dist):
        feed = Mock()
        tmp_dir = Mock()
        nectar_config = Mock()
        model = Mock(metadata=dict())
        report = Mock()
        files = treeinfo.process_distribution(feed, tmp_dir, nectar_config, model, report)

        self.assertEquals(0, len(files))
        self.assertEquals(None, model.metadata.get(constants.CONFIG_KEY_DISTRIBUTION_XML_FILE))
Пример #2
0
    def test_no_distribution(self, mock_get_dist):
        feed = Mock()
        tmp_dir = Mock()
        nectar_config = Mock()
        model = Mock(metadata=dict())
        report = Mock()
        files = treeinfo.process_distribution(feed, tmp_dir, nectar_config, model, report)

        self.assertEquals(0, len(files))
        self.assertEquals(None, model.metadata.get(constants.CONFIG_KEY_DISTRIBUTION_XML_FILE))
Пример #3
0
    def test_parse_good_file(self, mock_get_dist):
        feed = Mock()
        tmp_dir = Mock()
        nectar_config = Mock()
        model = Mock(metadata=dict())
        report = Mock()
        files = treeinfo.process_distribution(feed, tmp_dir, nectar_config, model, report)

        self.assertEquals(3, len(files))
        self.assertEquals('foo/bar.txt', files[0]['relativepath'])
        self.assertEquals('baz/qux.txt', files[1]['relativepath'])
        self.assertEquals(constants.DISTRIBUTION_XML, files[2]['relativepath'])
        self.assertEquals(model.metadata[constants.CONFIG_KEY_DISTRIBUTION_XML_FILE],
                          constants.DISTRIBUTION_XML)
Пример #4
0
    def test_parse_good_file(self, mock_get_dist):
        feed = Mock()
        tmp_dir = Mock()
        nectar_config = Mock()
        model = Mock(metadata=dict())
        report = Mock()
        files = treeinfo.process_distribution(feed, tmp_dir, nectar_config, model, report)

        self.assertEquals(3, len(files))
        self.assertEquals('foo/bar.txt', files[0]['relativepath'])
        self.assertEquals('baz/qux.txt', files[1]['relativepath'])
        self.assertEquals(constants.DISTRIBUTION_XML, files[2]['relativepath'])
        self.assertEquals(model.metadata[constants.CONFIG_KEY_DISTRIBUTION_XML_FILE],
                          constants.DISTRIBUTION_XML)