예제 #1
0
    def test_delete_old_entries(self):
        self.add_iax_general_settings()
        self.add_iax_general_settings()
        row = StaticIAX(var_name='nat', var_val='value1')

        iax_general_dao.edit_all([row])

        iax_general = iax_general_dao.find_all()
        assert_that(iax_general, equal_to([row]))
예제 #2
0
    def test_edit_all(self):
        row1 = StaticIAX(var_name='setting1', var_val='value1')
        row2 = StaticIAX(var_name='setting2', var_val='value1')
        row3 = StaticIAX(var_name='setting3', var_val='value1')
        row4 = StaticIAX(var_name='setting2', var_val='value2')

        iax_general_dao.edit_all([row3, row4, row2, row1])

        iax_general = iax_general_dao.find_all()
        assert_that(iax_general, equal_to([row3, row4, row2, row1]))
예제 #3
0
    def test_find_all_do_not_find_var_val_none(self):
        self.add_iax_general_settings(var_metric=1,
                                      var_name='setting1',
                                      var_val=None)
        row2 = self.add_iax_general_settings(var_metric=2,
                                             var_name='setting1',
                                             var_val='value1')

        iax_general = iax_general_dao.find_all()

        assert_that(iax_general, equal_to([row2]))
예제 #4
0
    def test_find_all(self):
        row1 = self.add_iax_general_settings(var_metric=3,
                                             var_name='setting1',
                                             var_val='value1')
        row2 = self.add_iax_general_settings(var_metric=2,
                                             var_name='setting2',
                                             var_val='value1')
        row3 = self.add_iax_general_settings(var_metric=1,
                                             var_name='setting3',
                                             var_val='value1')
        row4 = self.add_iax_general_settings(var_metric=4,
                                             var_name='setting2',
                                             var_val='value2')

        iax_general = iax_general_dao.find_all()

        assert_that(iax_general, equal_to([row3, row2, row1, row4]))
예제 #5
0
    def test_find_all_no_iax_general(self):
        result = iax_general_dao.find_all()

        assert_that(result, empty())