Merge branch 'cnfvar-deprecations'
[pyi2ncommon] / test / test_cnfline.py
diff --git a/test/test_cnfline.py b/test/test_cnfline.py
deleted file mode 100644 (file)
index 6999ab6..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-
-# The software in this package is distributed under the GNU General
-# Public License version 2 (with a special exception described below).
-#
-# A copy of GNU General Public License (GPL) is included in this distribution,
-# in the file COPYING.GPL.
-#
-# As a special exception, if other files instantiate templates or use macros
-# or inline functions from this file, or you compile this file and link it
-# with other works to produce a work based on this file, this file
-# does not by itself cause the resulting work to be covered
-# by the GNU General Public License.
-#
-# However the source code for this file must still be made available
-# in accordance with section (3) of the GNU General Public License.
-#
-# This exception does not invalidate any other reasons why a work based
-# on this file might be covered by the GNU General Public License.
-#
-# Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
-
-import unittest
-from src.cnfline.cnfline import CnfLine
-from src.cnfline.build_nic import BuildNIC
-
-
-class CnfLineTest(unittest.TestCase):
-    def test_simple(self):
-        line = CnfLine('MY_NAME', 123, 'my_data', 888, 456)
-
-        self.assertEqual('MY_NAME', line.name)
-        self.assertEqual(123, line.instance)
-        self.assertEqual('my_data', line.data)
-        self.assertEqual(888, line.line_no)
-        self.assertEqual(456, line.parent_line_no)
-
-    def test_deny_empty_name(self):
-        with self.assertRaises(ValueError):
-            CnfLine('')
-
-    def test_deny_lineno_zero(self):
-        with self.assertRaises(ValueError):
-            CnfLine('foobar', 0, 'some_data', 0)
-
-    def test_str_output_parent(self):
-        line = CnfLine('MY_NAME', 123, 'my_data', 10, 0)
-        self.assertEqual('10 MY_NAME,123: "my_data"', str(line))
-
-    def test_str_output_child(self):
-        line = CnfLine('MY_NAME', 123, 'my_data', 10, 456)
-        self.assertEqual('10 (456) MY_NAME,123: "my_data"', str(line))
-
-
-class BuildNICTest(unittest.TestCase):
-    def test_nic_comment(self):
-        nic = BuildNIC('my comment', 10, 100)
-
-        cnf_text = str(nic)
-        self.assertTrue('NIC_COMMENT,0: "my comment"' in cnf_text)
-        self.assertEqual('', nic.data)
-
-    def test_change_comment(self):
-        nic = BuildNIC('initial comment', 10, 100)
-        nic.comment('new comment')
-
-        cnf_text = str(nic)
-        self.assertTrue('NIC_COMMENT,0: "new comment"' in cnf_text)
-        self.assertTrue('initial comment"' not in cnf_text)
-        self.assertEqual('', nic.data)
-
-
-if __name__ == '__main__':
-    unittest.main()