forked from Hammie217/PyCtrl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
73 lines (72 loc) · 2.15 KB
/
Copy pathtest.py
File metadata and controls
73 lines (72 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import pytest
from main import *
def test_Tester(capfd):
print("Hello World!")
out, err = capfd.readouterr()
assert out == "Hello World!\n"
def test_CursorUp():
assert cursorUp(0) == -1
assert cursorUp(-1) == -1
assert cursorUp(-100) == -1
assert cursorUp(0.1) == -1
assert cursorUp("N") == -1
assert cursorUp('f') == -1
assert cursorUp([1,2]) == -1
assert cursorUp(1) == 0
assert cursorUp(5) == 0
def test_CursorDown():
assert cursorDown(0) == -1
assert cursorDown(-100) == -1
assert cursorDown(-1) == -1
assert cursorDown(0.1) == -1
assert cursorDown("N") == -1
assert cursorDown('f') == -1
assert cursorDown([1,2]) == -1
assert cursorDown(1) == 0
assert cursorDown(5) == 0
def test_CursorRight():
assert cursorRight(0) == -1
assert cursorRight(-1) == -1
assert cursorRight(-100) == -1
assert cursorRight(0.1) == -1
assert cursorRight("N") == -1
assert cursorRight('f') == -1
assert cursorRight([1,2]) == -1
assert cursorRight(1) == 0
assert cursorRight(5) == 0
def test_CursorLeft():
assert cursorLeft(0) == -1
assert cursorLeft(-1) == -1
assert cursorLeft(-100) == -1
assert cursorLeft(0.1) == -1
assert cursorLeft("N") == -1
assert cursorLeft('f') == -1
assert cursorLeft([1,2]) == -1
assert cursorLeft(1) == 0
assert cursorLeft(5) == 0
def test_SetColor():
assert setColor("Red")==0
print("Red")
assert setColor("black")==0
print("black")
assert setColor("WhItE")==0
print("WhItE")
assert setColor("Green")==0
print("Green")
assert setColor("RESET")==0
print("RESET")
assert setColor("Gren")==-1
assert setColor("unknown")==-1
assert setColor(6)==-1
assert setColor("R")==-1
assert setColor(["Hi","Bye"])==-1
assert setColor(0.1)==-1
assert setColor('f')==-1
def test_printList(capfd):
arr =["Choice1","Choice2","Choice3"]
printList(arr)
out, err = capfd.readouterr()
assert out == " Choice1\n\r Choice2\n\r Choice3\n\r"
def test_Single(capfd):
valArray=["Choice1","Choice2","Choice3"]
assert multiChoice(valArray,"Red","Text","fx","Magenta")== -1