Adding some tests

This commit is contained in:
Jamie Hardt
2024-07-07 14:40:52 -07:00
parent ce6542b64d
commit 0d765f9d84

30
tests/__init__.py Normal file
View File

@@ -0,0 +1,30 @@
"mfbatch tests"
import unittest
from mfbatch.commands import BatchfileParser
class CommandTests(unittest.TestCase):
def setUp(self):
self.command_parser = BatchfileParser()
def tearDown(self):
pass
def testSetCommand(self):
self.command_parser.set(['X', 'Y'])
self.assertEqual(self.command_parser.env.metadatums['X'], 'Y')
def testUnsetCommand(self):
self.command_parser.set(['A', '1'])
self.assertEqual(self.command_parser.env.metadatums['A'], '1')
self.command_parser.unset(['A'])
self.assertNotIn('A', self.command_parser.env.metadatums.keys())
def testSetP(self):
pass
def testEval(self):
self.command_parser.eval(":set A 1", 1, False)
self.assertEqual(self.command_parser.env.metadatums['A'], '1')