From 6aea4970befee1c9af8e2d0965951f33a1717abe Mon Sep 17 00:00:00 2001 From: rzaitov Date: Fri, 1 Nov 2013 20:15:24 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=83=20=D0=BF=D1=83=D0=B1?= =?UTF-8?q?=D0=BB=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D0=B8=20=D0=B2=20TF.=20?= =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=B8=D1=82=D1=8C=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=B7=D1=8F=20=D0=B8=D0=B7-=D0=B7=D0=B0=20?= =?UTF-8?q?=D0=BA=D1=8D=D1=88=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestflightCommandBuilder.py | 24 +++++++++++++++++++ scripts/Tests/ManualTests/testflight_test.py | 8 +++++++ scripts/commands/TestflightCommand.py | 2 +- scripts/run_manual_tests.py | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 scripts/CommandBuilders/TestflightCommandBuilder.py create mode 100644 scripts/Tests/ManualTests/testflight_test.py 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