def test_process_project_plural(self):

        tmpfile = self._dump_po_to_file(self.minipo_plural)

        index = IndexCreator('.')
        index.writer = IndexWriterMock()
        index._process_file('test_project', tmpfile.name, False, set())
        stored = index.writer.store
        self.assertEquals(stored[0]['source'], u'Delete this photo from camera?')
        self.assertEquals(stored[0]['target'], u'Voleu suprimir aquesta fotografia de la càmera?')

        self.assertEquals(stored[1]['source'], u'Delete these %d photos from camera?')
        self.assertEquals(stored[1]['target'], u'Voleu suprimir aquestes %d fotografies de la càmera?')

        self.assertEquals(index.sentences, 2)
        self.assertEquals(index.sentences_indexed, 2)
    def test_process_project(self):

        tmpfile = self._dump_po_to_file()

        index = IndexCreator('.')
        index.writer = IndexWriterMock()
        index._process_file('test_project', tmpfile.name, False, set())
        stored = index.writer.store

        self.assertEquals(stored['source'], u'Power off the selected virtual machines')
        self.assertEquals(stored['target'], u'Apaga les màquines virtuals seleccionades')
        self.assertEquals(stored['context'], 'Context')
        self.assertEquals(stored['comment'], 'Please remember to do something\r\n')
        self.assertEquals(stored['softcatala'], False)
        self.assertEquals(stored['project'], 'test_project')
        self.assertEquals(index.words, 5)
        self.assertEquals(index.sentences, 1)
        self.assertEquals(index.sentences_indexed, 1)
    def test_process_project(self):

        tmpfile = self._dump_po_to_file(self.minipo)

        index = IndexCreator('.')
        index.writer = IndexWriterMock()
        index._process_file('test_project', tmpfile.name, False, set())
        stored = index.writer.store

        self.assertEquals(stored[0]['source'], u'Power off the selected virtual machines')
        self.assertEquals(stored[0]['target'], u'Apaga les màquines virtuals seleccionades')
        self.assertEquals(stored[0]['context'], 'Context')
        self.assertEquals(stored[0]['comment'], 'Please remember to do something\r\n')
        self.assertEquals(stored[0]['softcatala'], False)
        self.assertEquals(stored[0]['project'], 'test_project')
        self.assertEquals(index.words, 5)
        self.assertEquals(index.sentences, 1)
        self.assertEquals(index.sentences_indexed, 1)