Пример #1
0
    def test_get_input_files_definition_latest(self):
        ci = CommonInterface()

        files = ci.get_input_files_definitions()

        self.assertEqual(len(files), 5)
        for file in files:
            if file.name == 'duty_calls.png':
                self.assertEqual(file.id, '151971455')
Пример #2
0
    def test_get_input_files_definition_nofilter(self):
        ci = CommonInterface()

        files = ci.get_input_files_definitions(only_latest_files=False)

        self.assertEqual(len(files), 6)
        for file in files:
            if file.name == 'duty_calls':
                self.assertEqual(file.tags, ["xkcd"])
                self.assertEqual(file.max_age_days, 180)
                self.assertEqual(file.size_bytes, 30027)
Пример #3
0
    def test_get_input_files_definition_by_tag(self):
        ci = CommonInterface()

        files = ci.get_input_files_definitions(tags=['dilbert'])

        self.assertEqual(len(files), 3)
        for file in files:
            if file.name == '21702.strip.print.gif':
                self.assertEqual(file.tags, ["dilbert"])
                self.assertEqual(file.max_age_days, 180)
                self.assertEqual(file.size_bytes, 4931)
Пример #4
0
    def test_get_input_files_definition_no_manifest_passes(self):
        ci = CommonInterface(
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'data_examples', 'data2'))

        files = ci.get_input_files_definitions(only_latest_files=True)

        self.assertEqual(len(files), 1)
        for file in files:
            self.assertEqual(file.max_age_days, 0)
            self.assertEqual(file.size_bytes, 0)
            self.assertEqual(file.created, None)
Пример #5
0
    def test_get_input_files_definition_by_tag_w_system(self):
        ci = CommonInterface(
            os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'data_examples', 'data_system_tags'))

        files = ci.get_input_files_definitions(tags=['dilbert'])

        self.assertEqual(len(files), 3)
        for file in files:
            if file.name == '21702.strip.print.gif':
                self.assertEqual(file.tags, [
                    "dilbert", "componentId: 1234", "configurationId: 12345",
                    "configurationRowId: 12345", "runId: 22123",
                    "branchId: 312321"
                ])
                self.assertEqual(file.max_age_days, 180)
                self.assertEqual(file.size_bytes, 4931)