From 983d559be761d2f30ffba08041c7a320d60a0b28 Mon Sep 17 00:00:00 2001 From: asstelite Date: Thu, 15 Nov 2018 17:38:08 +0200 Subject: [PATCH] changes --- task_4/tests.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/task_4/tests.py b/task_4/tests.py index 994fe35..7b7f753 100644 --- a/task_4/tests.py +++ b/task_4/tests.py @@ -1,8 +1,25 @@ +'''tests.py + +This test script is intended to looping of 'check' test as many times as many +numbers in the 'mapping' dictionary for the given letter. + +Arguments: + This script requires one argument (letter) + letter: Have to write 'a' or 'b' or 'c' . + +Run script under easypy: + $ python tests.py --letter 'write "a" or "b" or "c"' + +''' + +__author__ = 'Yurii Kobuk' + +import argparse +import sys from ats import aetest from ats.aetest import loop, test, setup - mapping = { 'a': (1, 3, 4, 5, 6, 7, 8), 'b': (0, 2, 3, 4), @@ -11,6 +28,10 @@ class Test(aetest.Testcase): + '''Testcase that takes one letter and ckecks if the letter is on mapping. + If the letter in on mapping the check function will make looping as many times + as many numbers in the 'mapping dictionary for the given number' + ''' @setup def setup(self, letter): @@ -26,4 +47,7 @@ def check(self, section): if __name__ == '__main__': - aetest.main() + parser = argparse.ArgumentParser(description="Write a letter") + parser.add_argument('--letter', type=str, required=True) + args, sys.argv[1:] = parser.parse_known_args(sys.argv[1:]) + aetest.main(letter=args.letter)