diff --git a/scripts/CommandBuilders/TestflightCommandBuilder.py b/scripts/CommandBuilders/TestflightCommandBuilder.py new file mode 100644 index 0000000..b1a3296 --- /dev/null +++ b/scripts/CommandBuilders/TestflightCommandBuilder.py @@ -0,0 +1,24 @@ +from commands.TestflightCommand import TestflightCommand +from parser.TestflightParser import TestflightParser + + +class TestflightCommandBuilder: + def __init__(self): + pass + + def isTestflight(self, line): + assert line is not None + + parser = TestflightParser() + isValid = parser.isValidLine(line) + + return isValid + + def getCommandFor(self, line): + assert line is not None + + parser = TestflightParser() + result = parser.parseLine(line) + + command = TestflightCommand(result['path'], result['api_token'], result['team_token'], result['notes']) + return command \ No newline at end of file diff --git a/scripts/Tests/ManualTests/testflight_test.py b/scripts/Tests/ManualTests/testflight_test.py new file mode 100644 index 0000000..8215ac3 --- /dev/null +++ b/scripts/Tests/ManualTests/testflight_test.py @@ -0,0 +1,8 @@ +from CommandBuilders.TestflightCommandBuilder import TestflightCommandBuilder + +line = "publish 'Output/Appstore/Artifacts/BuildSample-1.2.3.ipa' to testflight notes = 'Hello' api_token = '0e6925075d4fc10fed0e7bbf43fa6894_NjQ0OTI2MjAxMi0wOS0yNSAxMTo0MDozNi40OTY5MjU' team_token = 'c5c3cf7a6dae2bea4382dfbd181a2075_Mjc4ODkwMjAxMy0wOS0yOSAxNDowOTo1OC40Mzg5MTY'" + +builder = TestflightCommandBuilder() + +command = builder.getCommandFor(line) +command.execute() \ No newline at end of file diff --git a/scripts/commands/TestflightCommand.py b/scripts/commands/TestflightCommand.py index 1780ab4..f0b73f0 100644 --- a/scripts/commands/TestflightCommand.py +++ b/scripts/commands/TestflightCommand.py @@ -1,7 +1,7 @@ from utils.TestflightPublisher import TestFlightPublisher -class PublishToTestFlightCommand: +class TestflightCommand: def __init__(self, pathToFile, api_token, team_token, notes): assert pathToFile is not None diff --git a/scripts/run_manual_tests.py b/scripts/run_manual_tests.py index b287fcb..e4f2173 100644 --- a/scripts/run_manual_tests.py +++ b/scripts/run_manual_tests.py @@ -18,4 +18,5 @@ os.chdir(baseDir) #import ManualTests.remove_project #import ManualTests.infoplist_test #import ManualTests.clean_test +import Tests.ManualTests.testflight_test