コード例 #1
0
    def test_create_groupvector_pass0005(self):
        """Test for create_groupvector (Numpy arrays inputs)."""

        x = np.array([1, 2, 3])
        y = np.array([2, 4, 2])

        exp_output = np.array([1, 1, 2, 2, 2, 2, 3, 3])

        test_output = bdpy.create_groupvector(x, y)

        np.testing.assert_array_equal(test_output, exp_output)
コード例 #2
0
ファイル: test_util.py プロジェクト: pathakdivya/bdpy
    def test_create_groupvector_pass0003(self):
        '''Test for create_groupvector (Numpy array and scalar inputs).'''

        x = np.array([1, 2, 3])
        y = 2

        exp_output = np.array([1, 1, 2, 2, 3, 3])

        test_output = bdpy.create_groupvector(x, y)

        np.testing.assert_array_equal(test_output, exp_output)
コード例 #3
0
    def test_create_groupvector_pass0002(self):
        """Test for create_groupvector (list and list inputs)."""

        x = [1, 2, 3]
        y = [2, 4, 2]

        exp_output = [1, 1, 2, 2, 2, 2, 3, 3]

        test_output = bdpy.create_groupvector(x, y)

        self.assertTrue((test_output == exp_output).all())
コード例 #4
0
ファイル: test_util.py プロジェクト: pathakdivya/bdpy
    def test_create_groupvector_pass0001(self):
        '''Test for create_groupvector (list and scalar inputs).'''

        x = [1, 2, 3]
        y = 2

        exp_output = [1, 1, 2, 2, 3, 3]

        test_output = bdpy.create_groupvector(x, y)

        self.assertTrue((test_output == exp_output).all())