예제 #1
0
    def test_inlinepush(self):

        gui = window()
        gui.init_window(variant_name='classical',
                        random_pick=False,
                        debug=True)

        self.assertEqual(pos, pos_computed)
예제 #2
0
    def test_click(self):

        gui = window()
        gui.init_window(variant_name='classical',
                        random_pick=False,
                        debug=True)

        R = gui.theme['dimension']['marble_radius']
        pos = 0
        for pos, (x_bot_left,
                  y_bot_left) in enumerate(gui.theme['coordinates']):
            # get the center of the circle
            x_c = x_bot_left + R
            y_c = y_bot_left + R
            # add some noise
            noise_x = R * random.random()
            noise_y = (R - noise_x) * random.random()
            x = x_c + noise_x
            y = y_c + noise_y
            #
            pos_computed = gui.is_marbles_clicked(x, y)
            self.assertEqual(pos, pos_computed)
예제 #3
0
 def test_ordered_dictionary_interger_string_key_types(self):
     input = OrderedDict({"test": "a", 2: "b", 45: "c"})
     self.assertEqual(window(input), [('test', 2), (2, 45), (45, None)])
예제 #4
0
 def test_list_empty(self):
     input = []
     self.assertEqual(window(input), [([], None)])
예제 #5
0
 def test_dictionary(self):
     input = {1: "a", 2: "b", 3: "c"}
     self.assertEqual(window(input), [(1, 2), (2, 3), (3, None)])
예제 #6
0
 def test_ordered_dictionary(self):
     input = OrderedDict({1: "a", 2: "b", 3: "c"})
     self.assertEqual(window(input), [(1, 2), (2, 3), (3, None)])
예제 #7
0
 def test_set(self):
     input = {1, 2, 3, 4}
     self.assertEqual(window(input), [(1, 2), (2, 3), (3, 4), (4, None)])
예제 #8
0
 def test_list_multiple_items(self):
     input = [1, 2, 3, 4]
     self.assertEqual(window(input), [(1, 2), (2, 3), (3, 4), (4, None)])
예제 #9
0
 def test_list_single_item(self):
     input = [1]
     self.assertEqual(window(input), [(1, None)])
예제 #10
0
def go(q):
    q.put("Going")
    p2 = window(q)
예제 #11
0
def go(q):
    q.put("Going")
    p2 = window(q)