Python assertEquals generator -


i'm unit testing generator object contains objects. wanna check objects value property see if contains number, expected.

the generator object contains 5 object instances class test. wanna this:

pseudo code: test instance object's value property (test.value), in generator object (to list) equal [1, 2, 3, 4, 5].

is possible achieve using 1 line loop or inside assertequals method?

since it's 5 elements, use list comprehension.

assertequal([test.value test in test_instance_objects], [1, 2, 3, 4, 5]) 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -