示例#1
0
文件: test_utils.py 项目: dirn/Simon
    def test_set_write_concern_as_safe_with_w(self):
        """Test the `set_write_concern_as_safe()` method with `w`."""

        options = {'w': 1}
        set_write_concern_as_safe(options, False)
        self.assertEqual(options, {'safe': True})

        options = {'w': 0}
        set_write_concern_as_safe(options, False)
        self.assertEqual(options, {'safe': False})

        options = {'w': 0}
        set_write_concern_as_safe(options, True)
        self.assertEqual(options, {'safe': True})
示例#2
0
文件: test_utils.py 项目: dirn/Simon
    def test_set_write_concern_as_safe_with_w(self):
        """Test the `set_write_concern_as_safe()` method with `w`."""

        options = {'w': 1}
        set_write_concern_as_safe(options, False)
        self.assertEqual(options, {'safe': True})

        options = {'w': 0}
        set_write_concern_as_safe(options, False)
        self.assertEqual(options, {'safe': False})

        options = {'w': 0}
        set_write_concern_as_safe(options, True)
        self.assertEqual(options, {'safe': True})
示例#3
0
文件: test_utils.py 项目: dirn/Simon
    def test_set_write_concern_as_safe(self):
        """Test the `set_write_concern_as_safe()` method."""

        options = {'safe': True}
        set_write_concern_as_safe(options, False)
        self.assertEqual(options, {'safe': True})

        options = {'safe': False}
        set_write_concern_as_safe(options, False)
        self.assertEqual(options, {'safe': False})

        options = {'safe': False}
        set_write_concern_as_safe(options, True)
        self.assertEqual(options, {'safe': True})
示例#4
0
文件: test_utils.py 项目: dirn/Simon
    def test_set_write_concern_as_safe(self):
        """Test the `set_write_concern_as_safe()` method."""

        options = {'safe': True}
        set_write_concern_as_safe(options, False)
        self.assertEqual(options, {'safe': True})

        options = {'safe': False}
        set_write_concern_as_safe(options, False)
        self.assertEqual(options, {'safe': False})

        options = {'safe': False}
        set_write_concern_as_safe(options, True)
        self.assertEqual(options, {'safe': True})