def test_generate_file_name_invalid_artefact(self):
        artefact = dict()

        project = dict()
        project[GreenHouseWebhook.PayloadKey.Name] = 'test_app'

        dt = datetime.datetime(2015, month=11, day=21, hour=17, minute=10, second=5)
        webhook = GreenHouseWebhook()
        file_name = webhook.generate_file_name(project, artefact, dt)

        self.assertIsNone(file_name)
    def test_generate_file_name(self):
        artefact = dict()
        artefact[GreenHouseWebhook.PayloadKey.Type] = GreenHouseWebhook.Artefact.Apk
        artefact[GreenHouseWebhook.PayloadKey.Filename] = 'test_file'

        project = dict()
        project[GreenHouseWebhook.PayloadKey.Name] = 'test_app'

        dt = datetime.datetime(2015, month=11, day=21, hour=17, minute=10, second=5)
        webhook = GreenHouseWebhook()
        file_name = webhook.generate_file_name(project, artefact, dt)

        self.assertEqual('test_app_2015-11-21_17:10:05.apk', file_name)