Exemple #1
0
    def test_addstr(self, target):
        # call
        actual = target('abc', 'def')

        # verify
        expect = 'abcdef'
        assert actual == expect
Exemple #2
0
    def test_get_my_df(self, expected, target):
        target = target()
        # pandas.DataFrame同士が同一か確認する関数
        assert_frame_equal(target, expected)

        # numpyのarrayが同一か確認する関数
        npt.assert_array_equal(target, expected)
Exemple #3
0
    def test_addint(self, target):
        # call
        actual = target(1, 2)

        # verify
        expect = 3
        assert actual == expect
Exemple #4
0
    def _test_dict_stub():
        from src.myapp.main import dict_stub as target

        assert target() == {
            'name': 'Takayuki',
            'age': [1, 2, 4, 5],
            'work': {
                'sphinx': 'committer',
                'pyconjp': 'committer'
            }
        }
Exemple #5
0
 def test_typeerror(self, target):
     with pytest.raises(TypeError):
         target('abc', 'def')
Exemple #6
0
 def test_subint(self, input, expect, target):
     actual = target(*input)
     assert actual == expect, '{}.{}関数いけてねえ'.format(target.__module__,
                                                    target.__name__)
Exemple #7
0
    def test_add_using_parametrize(self, target, a, b, expected):
        # call
        actual = target(a, b)

        # verify
        assert actual == expected