Пример #1
0
    def test_assert_not_equal(self):
        assert_not_equal(1, 2)

        class A(object):
            pass

        assert_not_equal(A(), A())
Пример #2
0
    def test_simple_merge(self):
        """Test merging a config with an empty 'cartoVars' attribute."""
        with codecs.open(self.source, 'r', 'utf-8') as f:
            source_mss = f.read()

        result = process_mss(self.source, self.config)
        lines = result.splitlines()
        source_lines = source_mss.splitlines()

        # Make sure we changed something, but that the number of lines is
        # unchanged
        assert_not_equal(result, source_mss)
        assert_equal(len(lines), len(source_lines))

        for i, (old, new) in enumerate(zip(source_lines, lines)):
            # We know there's a variable on this line that has a substitution
            # in our test config
            if i == 29:
                # Make sure we've changed something, but that the new output is
                # still a valid MSS variable
                assert_not_equal(old, new)
                assert_match_regex(MSS_VAR_RE, new)
                assert_equal(
                    new[-5:-1],
                    self.config.get('cartoVars').get('park')
                )
            else:
                assert_equal(old, new)
Пример #3
0
 def test_assert_not_equal(self):
     with assert_raises(AssertionError):
         assert_not_equal(1, 1)