def test_windows_setup(self): self.store.storeNode('files/node.bam', '', 'window_r') self.store.storeNode('files/hood_node.bam', '', 'window_l') windows = DNAWindows('windows') x = .1 y = .4 np = NodePath('window_root') code = 'window_l' scale = 1.25 color = Vec4(.842, .167, .361, 1) windows.makeWindows(x, y, np, code, scale, color, self.store, False) # Check if the nodes attributes are correct model = np.find('**/node') self.assertFalse(model.isEmpty()) self.assertEqual(model.getPos(np), Point3(x, 0, y)) self.assertEqual(model.getScale(np), Vec3(scale)) # Now test with flip = True np.removeNode() np = NodePath('window_root') windows.makeWindows(x, y, np, code, scale, color, self.store, True) # Check if the nodes attributes are correct model = np.find('**/hood_node') self.assertFalse(model.isEmpty()) self.assertEqual(model.getPos(np), Point3(x, 0, y)) self.assertEqual(model.getScale(np), Vec3(scale))
def test_windows(self): windows = DNAWindows('windows') self._test_color_and_code(windows) self.assertEqual(windows.getWindowCount(), 1) windows.setWindowCount(3) self.assertEqual(windows.getWindowCount(), 3)