def test_csv_ingestor__parse__complete(self):
     """Test CSV file ingestor, parse function."""
     result = CSVIngestor.parse(TestQuoteEngine.quote_csv_file)
     self.assertEqual(len(result), 2)
     self.assertEqual(result[0].__repr__(), '"Chase the mailman" - Skittle')
     self.assertEqual(result[1].__repr__(),
                      '"When in doubt, go shoe-shopping" - Mr. Paws')
Exemplo n.º 2
0
from QuoteEngine import CSVIngestor, DocxIngestor, PDFIngestor, TXTIngestor
from QuoteEngine import Ingestor
from MemeEngine import MemeEngine

if __name__ == '__main__':
    base_path = '/Users/Neeraj/Development/meme_generator/_data/DogQuotes/'
    print(CSVIngestor.parse(base_path + 'DogQuotesCSV.csv'))
    print(DocxIngestor.parse(base_path + 'DogQuotesDOCX.docx'))
    print(PDFIngestor.parse(base_path + 'DogQuotesPDF.pdf'))
    print(TXTIngestor.parse(base_path + 'DogQuotesTXT.txt'))
    print(Ingestor.Ingestor.parse(base_path + 'DogQuotesCSV.csv'))

    meme_gen = MemeEngine('/Users/Neeraj/Development/meme_generator/_data')
    output = meme_gen.make_meme('./_data/photos/dog/xander_1.jpg',
                                'Hello World!', 'Macbook Pro')
    print(output)
Exemplo n.º 3
0
def test_csv_ingestor_parse():
    assert CSVIngestor.parse(TEST_CSV) == TEST_QUOTES