예제 #1
0
파일: tests.py 프로젝트: pombredanne/phdlib
    def test_between_block_pairs(self):
        expected = set()
        block_pairs = itertools.combinations(self.blocks, 2)
        for left_block, right_block in block_pairs:
            for x in left_block:
                for y in right_block:
                    expected.add(frozenset((x, y)))

        actual = phdlib.between_block_pairs(self.blocks)
        actual_set = set(frozenset(pair) for pair in actual)

        self.assertEqual(len(actual), len(actual_set))
        self.assertEqual(actual_set, expected)
예제 #2
0
파일: tests.py 프로젝트: pombredanne/phdlib
 def test_returns_ndarray(self):
     result = phdlib.between_block_pairs(self.blocks)
     self.assertIsInstance(result, np.ndarray)