def test_prevod_delky(self): """Testuje metodu prevod delky.""" tmp = Uprava_jednotek(sA=5, sB=55, sC=300, unsA="m", unsB="dm", unsC="cm") tmp.prevod_delky() test = { 1: (tmp.sA, tmp.unsA), 2: (tmp.sB, tmp.unsB), 3: (tmp.sC, tmp.unsC) } result = {1: (500, 'cm'), 2: (550, 'cm'), 3: (300, 'cm')} assert test == result
def test_int_to_uhel(self): """Testuje metodu int to uhel.""" test = Uprava_jednotek(unuC=2) result = "rad" assert test.int_to_uhel(test.unuC) == result
def test_uhel_to_int(self): """Testuje metodu uhel to int.""" test = Uprava_jednotek(unuC="°") result = 1 assert test.uhel_to_int(test.unuC) == result
def test_dve_strany(self): """Testuje metodu dve strany.""" test = Uprava_jednotek(sA=5, sB=55, unsA="m", unsB="dm") result = ('dm', 'dm', 50, 55) assert test.dve_strany(test.unsA, test.unsB, test.sA, test.sB) == result
def test_delka_to_int(self): """Testuje metodu delka to int.""" test = Uprava_jednotek(unsA="m") result = 4 assert test.delka_to_int(test.unsA) == result
def test_int_to_delka(self): """Testuje metodu int to delka.""" test = Uprava_jednotek(unsA=1) result = "mm" assert test.int_to_delka(test.unsA) == result
def test_to_rad(self): """Testuje převod na radiany.""" test = Uprava_jednotek().to_rad(u1=360, uhel1="°") result = math.pi * 2 assert test == result