Beispiel #1
0
 def test_matches(self):
     CheckerView(path.join(test_files,'testall.xls'))['Sheet1'].compare(
         (u'R0C0', u'R0C1'),
         (u'R1C0', u'R1C1'),
         (u'A merged cell', ''),
         ('', ''),
         ('', ''),
         (u'More merged cells', '')
         )
Beispiel #2
0
    def test_does_not_match(self):
        with ShouldRaise(
                AssertionError('''\
Sequence not as expected:

same:
((u'R0C0', u'R0C1'),
 (u'R1C0', u'R1C1'),
 (u'A merged cell', ''),
 ('', ''),
 ('', ''))

first:
((u'More merged cells', 'XX'),)

second:
((u'More merged cells', ''),)''')):
            CheckerView(path.join(test_files,
                                  'testall.xls'))['Sheet1'].compare(
                                      (u'R0C0', u'R0C1'), (u'R1C0', u'R1C1'),
                                      (u'A merged cell', ''), ('', ''),
                                      ('', ''), (u'More merged cells', 'XX'))
Beispiel #3
0
    def test_does_not_match(self):
        with ShouldRaise(AssertionError) as s:
            CheckerView(path.join(test_files,
                                  'testall.xls'))['Sheet1'].compare(
                                      (u'R0C0', u'R0C1'), (u'R1C0', u'R1C1'),
                                      (u'A merged cell', ''), ('', ''),
                                      ('', ''), (u'More merged cells', 'XX'))

        if PY3:
            expected = """\
sequence not as expected:

same:
(('R0C0', 'R0C1'), ('R1C0', 'R1C1'), ('A merged cell', ''), ('', ''), ('', ''))

expected:
(('More merged cells', 'XX'),)

actual:
(('More merged cells', ''),)

While comparing [5]: sequence not as expected:

same:
('More merged cells',)

expected:
('XX',)

actual:
('',)

While comparing [5][1]: 'XX' (expected) != '' (actual)"""
        else:
            expected = '''\
sequence not as expected:

same:
((u'R0C0', u'R0C1'),
 (u'R1C0', u'R1C1'),
 (u'A merged cell', ''),
 ('', ''),
 ('', ''))

expected:
((u'More merged cells', 'XX'),)

actual:
((u'More merged cells', u''),)

While comparing [5]: sequence not as expected:

same:
(u'More merged cells',)

expected:
('XX',)

actual:
(u'',)

While comparing [5][1]: 'XX' (expected) != u'' (actual)'''

        compare(expected, actual=str(s.raised))