Example #1
0
 def test_parse_1(self):
     parser = BooksParser("Books.xml")
     parser.parse()
     self.assertNotEqual(0, len(parser._books_list))
Example #2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
@author: Paweł Pęksa
"""

from src.BooksParser import BooksParser
import logging

if __name__ == '__main__':
    logging.info('Lab 01 | Problem 2')
    parser = BooksParser("Books.xml")
    parser.parse()
    parser.print_books()



Example #3
0
 def testIfXMLIncorrect(self):
     parser = BooksParser("invalidBooks.xml")
     self.assertRaises(ET.ParseError)
Example #4
0
 def test_parse_1(self):
     parser = BooksParser("Books.xml")
     parser.parse()
     self.assertNotEqual(0, len(parser._books_list))
Example #5
0
 def test_init_2(self):
     with self.assertRaises(SystemExit):
         book_parser = BooksParser("")
Example #6
0
 def test_init_1(self):
     with self.assertRaises(SystemExit):
         book_parser = BooksParser("no_exist")