def test_strings(self):
     project = WtiProject('dummy_id', 'dummy_name', 'dummy_locale',
                          'file.strings', WtiContentTypes.ios)
     base = WtiString('id1', 'locale1', 'aaa http://www.link.com aaa',
                      'STATUS', '2015-01-22T00:05:01Z', False)
     other = WtiString('id2', 'locale2', 'aaa', 'STATUS',
                       '2015-01-22T00:05:01Z', False)
     compare.diff(self.client, project, base, other)
     self.assertFalse(self.mock_request.called)
 def _test_ios_text(self):
     project = WtiProject('dummy_id', 'dummy_name', 'dummy_locale',
                          'file.txt', WtiContentTypes.ios)
     base = WtiString('id1', 'locale1', 'aaa http://www.link.com aaa',
                      'STATUS', '2015-01-22T00:05:01Z', False)
     other = WtiString('id2', 'locale2', 'aaa', 'STATUS',
                       '2015-01-22T00:05:01Z', False)
     return compare.diff(self.client, project, base, other)
 def test_invalid_plural_strings(self):
     text_base = {'one': 'AAA', 'two': 'BBB'}
     text_other = {'one': 'ABB', 'two': '# CAA'}
     project = WtiProject('dummy_id', 'dummy_name', 'dummy_locale',
                          'file.md', WtiContentTypes.md)
     base = WtiString('id1', 'locale1', text_base, 'STATUS',
                      '2015-01-22T00:05:01Z', True)
     other = WtiString('id2', 'locale2', text_other, 'STATUS',
                       '2015-01-22T00:05:01Z', True)
     diff = compare.diff(self.client, project, base, other)
     self.assertTrue(diff.md_error)
 def _test_md(self, other):
     project = WtiProject('dummy_id', 'dummy_name', 'dummy_locale',
                          'file.md', WtiContentTypes.md)
     base = WtiString('id1', 'locale1', 'aaa\n\naaa', 'STATUS',
                      '2015-01-22T00:05:01Z', False)
     return compare.diff(self.client, project, base, other)