本文整理汇总了Python中tests.compare.is_equal函数的典型用法代码示例。如果您正苦于以下问题:Python is_equal函数的具体用法?Python is_equal怎么用?Python is_equal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_equal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_aug_onelist_pos
def test_aug_onelist_pos(self):
# CREATE
r_1, r_2 = ysanity.Runner(), ysanity.Runner()
e_1 = ysanity.Runner.OneList.OneAugList.Ldata()
e_2 = ysanity.Runner.OneList.OneAugList.Ldata()
e_1.number = 1
e_1.name = e_1._common_path
e_2.number = 2
e_2.name = e_2._common_path
r_1.one_list.one_aug_list.ldata.extend([e_1, e_2])
r_1.one_list.one_aug_list.enabled = True
self.crud.create(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
# UPDATE
r_1, r_2 = ysanity.Runner(), ysanity.Runner()
e_1 = ysanity.Runner.OneList.OneAugList.Ldata()
e_2 = ysanity.Runner.OneList.OneAugList.Ldata()
e_1.number = 1
e_1.name = e_1._common_path.replace(':', '/')
e_2.number = 2
e_2.name = e_2._common_path.replace(':', '/')
r_1.one_list.one_aug_list.ldata.extend([e_1, e_2])
r_1.one_list.one_aug_list.enabled = True
self.crud.update(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
# DELETE
r_1 = ysanity.Runner()
self.crud.delete(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(r_2._has_data(), False)
示例2: test_onelsit_pos
def test_onelsit_pos(self):
# READ
r_1, r_2 = ysanity.Runner(), ysanity.Runner()
e_1, e_2 = ysanity.Runner.OneList.Ldata(), ysanity.Runner.OneList.Ldata()
e_1.number = 1
e_1.name = 'runner:onelist:ldata['+str(e_1.number)+']:name'
e_2.number = 2
e_2.name = 'runner:onelist:ldata['+str(e_2.number)+']:name'
r_1.one_list.ldata.extend([e_1, e_2])
self.crud.create(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
# UPDATE
r_1, r_2 = ysanity.Runner(), ysanity.Runner()
e_1, e_2 = ysanity.Runner.OneList.Ldata(), ysanity.Runner.OneList.Ldata()
e_1.number = 1
e_1.name = 'runner:onelist:ldata['+str(e_1.number)+']:name'
e_2.number = 2
e_2.name = 'runner:onelist:ldata['+str(e_2.number)+']:name'
r_1.one_list.ldata.extend([e_1, e_2])
self.crud.update(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
# DELETE
r_1 = ysanity.Runner()
self.crud.delete(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_1)
self.assertEqual(r_2._has_data(), False)
示例3: test_twolist_pos
def test_twolist_pos(self):
# READ
r_1, r_2 = ysanity.Runner(), ysanity.Runner()
e_1, e_2 = ysanity.Runner.TwoList.Ldata(), ysanity.Runner.TwoList.Ldata()
e_11, e_12 = ysanity.Runner.TwoList.Ldata.Subl1(), ysanity.Runner.TwoList.Ldata.Subl1()
e_1.number = 21
e_1.name = 'runner:twolist:ldata['+str(e_1.number)+']:name'
e_11.number = 211
e_11.name = 'runner:twolist:ldata['+str(e_1.number)+']:subl1['+str(e_11.number)+']:name'
e_12.number = 212
e_12.name = 'runner:twolist:ldata['+str(e_1.number)+']:subl1['+str(e_12.number)+']:name'
e_1.subl1.extend([e_11, e_12])
e_21, e_22 = ysanity.Runner.TwoList.Ldata.Subl1(), ysanity.Runner.TwoList.Ldata.Subl1()
e_2.number = 22
e_2.name = 'runner:twolist:ldata['+str(e_2.number)+']:name'
e_21.number = 221
e_21.name = 'runner:twolist:ldata['+str(e_2.number)+']:subl1['+str(e_21.number)+']:name'
e_22.number = 222
e_22.name = 'runner:twolist:ldata['+str(e_2.number)+']:subl1['+str(e_22.number)+']:name'
e_2.subl1.extend([e_21, e_22])
r_1.two_list.ldata.extend([e_1, e_2])
self.crud.create(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
# UPDATE
r_1, r_2 = ysanity.Runner(), ysanity.Runner()
e_1, e_2 = ysanity.Runner.TwoList.Ldata(), ysanity.Runner.TwoList.Ldata()
e_11, e_12 = ysanity.Runner.TwoList.Ldata.Subl1(), ysanity.Runner.TwoList.Ldata.Subl1()
e_1.number = 21
e_1.name = 'runner/twolist/ldata['+str(e_1.number)+']/name'
e_11.number = 211
e_11.name = 'runner/twolist/ldata['+str(e_1.number)+']/subl1['+str(e_11.number)+']/name'
e_12.number = 212
e_12.name = 'runner/twolist/ldata['+str(e_1.number)+']/subl1['+str(e_12.number)+']/name'
e_1.subl1.extend([e_11, e_12])
e_21, e_22 = ysanity.Runner.TwoList.Ldata.Subl1(), ysanity.Runner.TwoList.Ldata.Subl1()
e_2.number = 22
e_2.name = 'runner/twolist/ldata['+str(e_2.number)+']/name'
e_21.number = 221
e_21.name = 'runner/twolist/ldata['+str(e_2.number)+']/subl1['+str(e_21.number)+']/name'
e_22.number = 222
e_22.name = 'runner/twolist/ldata['+str(e_2.number)+']/subl1['+str(e_22.number)+']/name'
e_2.subl1.extend([e_21, e_22])
r_1.two_list.ldata.extend([e_1, e_2])
self.crud.update(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
# DELETE
r_1 = ysanity.Runner()
self.crud.delete(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_1)
self.assertEqual(r_2._has_data(), False)
示例4: test_read_on_identity_ref
def test_read_on_identity_ref(self):
r_1 = ysanity.Runner.Ytypes.BuiltInT()
r_1.identity_ref_value = ysanity.ChildIdentity_Identity()
self.crud.create(self.ncc, r_1)
r_2 = ysanity.Runner.Ytypes.BuiltInT()
r_2.identity_ref_value = READ()
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
r_2 = ysanity.Runner.Ytypes.BuiltInT()
r_2.identity_ref_value = ysanity.ChildIdentity_Identity()
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
示例5: test_read_on_leaflist
def test_read_on_leaflist(self):
r_1 = ysanity.Runner.Ytypes.BuiltInT()
r_1.llstring = ['1', '2', '3']
self.crud.create(self.ncc, r_1)
r_2 = ysanity.Runner.Ytypes.BuiltInT()
r_2.llstring = READ()
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
r_2 = ysanity.Runner.Ytypes.BuiltInT()
# invalid input, user should use READ()
# or the same data on device
r_2.llstring = ['something emaillse']
r_2 = self.crud.read(self.ncc, r_2)
self.assertNotEqual(is_equal(r_1, r_2), True)
示例6: test_CASE6
def test_CASE6(self):
a = ysanity.A()
a.b.c = a.b.C()
a = self.crud.read(self.ncc, a)
_a = ysanity.A()
_a.b.c = _a.b.C()
self.assertEqual(is_equal(a, _a), True)
示例7: test_delete_operation_on_list
def test_delete_operation_on_list(self):
# create runner with a container and a list
runner_create = ysanity.Runner()
runner_create.one.name = 'one'
elem1 = ysanity.Runner.OneList.Ldata()
elem2 = ysanity.Runner.OneList.Ldata()
elem1.number = 1
elem2.name = 'foo'
elem2.number = 1
elem2.name = 'bar'
runner_create.one_list.ldata.extend([elem1, elem2])
self.crud.create(self.ncc, runner_create)
runner_read_filter = ysanity.Runner()
runner_read = self.crud.read(self.ncc, runner_read_filter)
self.crud.delete(self.ncc, runner_read.one_list.ldata)
runner_read = self.crud.read(self.ncc, runner_read_filter)
runner_left = runner_create
del runner_left.one_list.ldata[:]
self.assertEqual(is_equal(runner_read, runner_left), True)
示例8: test_CASE4
def test_CASE4(self):
a = ysanity.A()
a.b.b1 = "some value"
a = self.crud.read(self.ncc, a)
_a = self.getInitEntity()
_a.lst, _a.a1, _a.a2, _a.a3 = YList(), None, None, None
self.assertEqual(is_equal(a, _a), True)
示例9: test_CASE2
def test_CASE2(self):
a = ysanity.A()
a.a1 = "some value"
a = self.crud.read(self.ncc, a)
# the whole thing
_a = self.getInitEntity()
self.assertEqual(is_equal(a, _a), True)
示例10: test_CASE3
def test_CASE3(self):
a = ysanity.A()
a.a1 = READ()
a = self.crud.read(self.ncc, a)
_a = ysanity.A()
_a.a1 = "some value"
self.assertEqual(is_equal(a, _a), True)
示例11: test_delete_operation_on_list_slice
def test_delete_operation_on_list_slice(self):
runner_create = ysanity.Runner()
runner_create.one.name = 'one'
foo = ysanity.Runner.OneList.Ldata()
bar = ysanity.Runner.OneList.Ldata()
baz = ysanity.Runner.OneList.Ldata()
foo.number = 1
foo.name = 'foo'
bar.number = 2
bar.name = 'bar'
baz.number = 3
baz.name = 'baz'
runner_create.one_list.ldata.extend([foo, bar, baz])
self.crud.create(self.ncc, runner_create)
runner_read = self.read_from_empty_filter()
elements_to_delete = runner_read.one_list.ldata[:1]
self.crud.delete(self.ncc, elements_to_delete)
# read after a crud delete operation
runner_read = self.read_from_empty_filter()
runner_left = runner_create
# manually delete entire list
del runner_left.one_list.ldata[:1]
self.assertEqual(is_equal(runner_read, runner_left), True)
示例12: test_CASE5
def test_CASE5(self):
a = ysanity.A()
e = a.b.d.e
e.e1 = "some value e1"
a = self.crud.read(self.ncc, a)
_a = ysanity.A()
_a.b.d.e.e1, _a.b.d.e.e2 = "some value e1", "value of e2"
self.assertEqual(is_equal(a, _a), True)
示例13: test_read_on_ref_class
def test_read_on_ref_class(self):
r_1 = ysanity.Runner()
r_1.one.number, r_1.one.name = 1, 'runner:one:name'
self.crud.create(self.ncc, r_1)
r_2 = ysanity.Runner()
r_2.one = READ()
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
示例14: test_edit_commit_get
def test_edit_commit_get(self):
runner = ysanity.Runner()
runner.one.number = 1
runner.one.name = 'runner:one:name'
get_filter = ysanity.Runner()
op = self.netconf_service.edit_config(self.ncc, Datastore.candidate, runner)
self.assertIn('ok', op)
result = self.netconf_service.get_config(self.ncc, Datastore.candidate, get_filter)
self.assertEqual(is_equal(runner, result), True)
op = self.netconf_service.commit(self.ncc)
self.assertIn('ok', op)
result = self.netconf_service.get(self.ncc, get_filter)
self.assertEqual(is_equal(runner, result), True)
示例15: test_one_level_pos
def test_one_level_pos(self):
# READ
r_1, r_2 = ysanity.Runner(), ysanity.Runner()
r_1.one.number, r_1.one.name = 1, 'runner:one:name'
self.crud.create(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
# UPDATE
r_1, r_2 = ysanity.Runner(), ysanity.Runner()
r_1.one.number, r_1.one.name = 10, 'runner/one/name'
self.crud.update(self.ncc, r_1)
r_2 = self.crud.read(self.ncc, r_2)
self.assertEqual(is_equal(r_1, r_2), True)
# DELETE
r_1 = ysanity.Runner()
self.crud.delete(self.ncc,r_1)
r_2 = self.crud.read(self.ncc, r_1)
self.assertEqual(r_2._has_data(), False)