-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_commit_change.py
36 lines (27 loc) · 1.07 KB
/
test_commit_change.py
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
from commit import *
from codeCommit import *
from change import *
import pytest
@pytest.mark.parametrize("change", [Add("promena")])
def testAddChange(change): #test za add change metodu u codecommit klasi
objekat = CodeCommit(0, None)
objekat.changes.append(change)
assert objekat.changes[-1] == change
@pytest.mark.parametrize("content", [0])
def testValidateContent(content):
with pytest.raises(ValueError) as err:
added = Add(content)
added.validate_content
assert str(err.value) == "kontent mora da bude string"
@pytest.mark.parametrize("content", [0])
def testValidateContent(content):
with pytest.raises(ValueError) as err:
deleted = Delete(content)
deleted.validate_content
assert str(err.value) == "kontent mora da bude string"
@pytest.mark.parametrize("content", [0])
def testValidateContent(content):
with pytest.raises(ValueError) as err:
modifikacija = Modifikacija(content)
modifikacija.validate_content()
assert str(err.value) == "kontent mora da bude string"