Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions task_4/tests.py
Original file line number Diff line number Diff line change
@@ -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),
Expand All @@ -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):
Expand All @@ -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)