Beispiel #1
0
 def test_searches_all_namespaces_if_ns_not_in_current(self):
     pm.namespace(set=':')
     ns = self.create_namespace(':foo')
     ns2 = self.create_namespace(':bar')
     pm.namespace(set=ns2)
     namespaceutils.set_namespace('foo')
     current_ns = pm.namespaceInfo(currentNamespace=True)
     self.assertEqual(ns, current_ns)
Beispiel #2
0
 def test_start_at_root_true(self):
     pm.namespace(set=':')
     ns_foo = self.create_namespace(':foo')
     ns_bar = self.create_namespace(':bar')
     ns_bar_foo = self.create_namespace(':bar:foo')
     ns_bar_foo_spam_foo = self.create_namespace(':bar:foo:spam:foo')
     pm.namespace(set=ns_bar)
     namespaceutils.set_namespace('foo', start_at_root=True)
     current_ns = pm.namespaceInfo(currentNamespace=True)
     self.assertEqual(ns_foo, current_ns)
Beispiel #3
0
 def test_if_multiple_matching_ns_take_first_nested_first(self):
     pm.namespace(set=':')
     ns_foo = self.create_namespace(':foo')
     ns_bar = self.create_namespace(':bar')
     ns_bar_foo = self.create_namespace(':bar:foo')
     ns_bar_foo_spam_foo = self.create_namespace(':bar:foo:spam:foo')
     pm.namespace(set=ns_bar)
     namespaceutils.set_namespace('foo')
     current_ns = pm.namespaceInfo(currentNamespace=True)
     self.assertEqual(ns_bar_foo, current_ns)
Beispiel #4
0
 def test_set_from_root_without_colon_prefix(self):
     pm.namespace(set=':')
     ns = self.create_namespace(':foo')
     namespaceutils.set_namespace('foo')
     current_ns = pm.namespaceInfo(currentNamespace=True)
     self.assertEqual(ns, current_ns)