예제 #1
0
파일: Users.py 프로젝트: charlyne/nouse
class Users(unittest.TestCase):
    def setUp(self):
        #get api's case
        self.api = SmsAPI("users")
        self.caselist = self.api.getCaseList()

    def tearDown(self):
        pass

    def test_case1(self):
        act_rs = self.caselist[0]["act_rs"]
        exp_rs = eval(self.caselist[0]["exp_rs"])
        self.assertTrue(self.api.comparedRS(act_rs, exp_rs), act_rs)

    def test_case2(self):
        act_rs = self.caselist[1]["act_rs"]
        exp_rs = eval(self.caselist[1]["exp_rs"])
        self.assertTrue(self.api.comparedRS(act_rs, exp_rs), act_rs)

    def test_case3(self):
        act_rs = self.caselist[2]["act_rs"]
        exp_rs = eval(self.caselist[2]["exp_rs"])
        self.assertTrue(self.api.comparedRS(act_rs, exp_rs), act_rs)

    def test_case4(self):
        act_rs = self.caselist[3]["act_rs"]
        exp_rs = eval(self.caselist[3]["exp_rs"])
        self.assertTrue(self.api.comparedRS(act_rs, exp_rs), act_rs)
예제 #2
0
class TestMathUnitTest(unittest.TestCase):
    @parameterized.expand([
        #(caselist[0]["name"],caselist[0]["exp_rs"],caselist[0]["exp_rs"]),
        ("22", "act_rs", "exp_rs"),
    ])
    def test_floor(self, name, input, expected):
        assert_equal(input, expected)

    def setUp(self):
        #get api's case
        self.api = SmsAPI("handshake")
        self.caselist = self.api.getCaseList()

    def test_handshake(self):
        pass
예제 #3
0
class Condition(unittest.TestCase):
    def setUp(self):
        self.api = SmsAPI("condition")
        self.caselist = self.api.getCaseList()

    def tearDown(self):
        pass

    def test_case1(self):
        act_rs = self.caselist[0]["act_rs"]
        exp_rs = eval(self.caselist[0]["exp_rs"])
        self.assertTrue(self.api.comparedRS(act_rs, exp_rs), act_rs)

    def test_case2(self):
        act_rs = self.caselist[1]["act_rs"]
        exp_rs = eval(self.caselist[1]["exp_rs"])
        self.assertTrue(self.api.comparedRS(act_rs, exp_rs), act_rs)