kopia lustrzana https://github.com/ctjacobs/pyqso
Updated unit tests.
rodzic
e34253adb2
commit
2e074df388
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
import logging
|
import logging
|
||||||
import sqlite
|
import sqlite3 as sqlite
|
||||||
|
|
||||||
|
|
||||||
class Awards:
|
class Awards:
|
||||||
|
|
|
@ -130,8 +130,7 @@ class TestADIF(unittest.TestCase):
|
||||||
""" Check that records can be written to an ADIF file correctly. """
|
""" Check that records can be written to an ADIF file correctly. """
|
||||||
records = [{"CALL": "TEST123", "QSO_DATE": "20120402", "TIME_ON": "1234", "FREQ": "145.500", "BAND": "2m", "MODE": "FM", "RST_SENT": "59", "RST_RCVD": "59"},
|
records = [{"CALL": "TEST123", "QSO_DATE": "20120402", "TIME_ON": "1234", "FREQ": "145.500", "BAND": "2m", "MODE": "FM", "RST_SENT": "59", "RST_RCVD": "59"},
|
||||||
{"CALL": "TEST123", "QSO_DATE": "20130312", "TIME_ON": "0101", "FREQ": "145.750", "BAND": "2m", "MODE": "FM"}]
|
{"CALL": "TEST123", "QSO_DATE": "20130312", "TIME_ON": "0101", "FREQ": "145.750", "BAND": "2m", "MODE": "FM"}]
|
||||||
success = self.adif.write(records, "ADIF.test_write.adi")
|
self.adif.write(records, "ADIF.test_write.adi")
|
||||||
assert(success)
|
|
||||||
|
|
||||||
f = open("ADIF.test_write.adi", 'r')
|
f = open("ADIF.test_write.adi", 'r')
|
||||||
text = f.read()
|
text = f.read()
|
||||||
|
@ -173,8 +172,7 @@ class TestADIF(unittest.TestCase):
|
||||||
records = c.fetchall()
|
records = c.fetchall()
|
||||||
print(records)
|
print(records)
|
||||||
|
|
||||||
success = self.adif.write(records, "ADIF.test_write_sqlite3_Row.adi")
|
self.adif.write(records, "ADIF.test_write_sqlite3_Row.adi")
|
||||||
assert(success)
|
|
||||||
|
|
||||||
f = open("ADIF.test_write_sqlite3_Row.adi", 'r')
|
f = open("ADIF.test_write_sqlite3_Row.adi", 'r')
|
||||||
text = f.read()
|
text = f.read()
|
||||||
|
|
|
@ -47,8 +47,7 @@ END-OF-LOG:"""
|
||||||
mycall = "MYCALL"
|
mycall = "MYCALL"
|
||||||
mycontest = "MYCONTEST"
|
mycontest = "MYCONTEST"
|
||||||
path = "Cabrillo.test_write.log"
|
path = "Cabrillo.test_write.log"
|
||||||
success = self.cabrillo.write(records, path, contest=mycontest, mycall=mycall)
|
self.cabrillo.write(records, path, contest=mycontest, mycall=mycall)
|
||||||
assert(success)
|
|
||||||
|
|
||||||
actual = ""
|
actual = ""
|
||||||
f = open(path, "r")
|
f = open(path, "r")
|
||||||
|
|
Ładowanie…
Reference in New Issue