Реализовал тесты для настроек проекта
This commit is contained in:
parent
1512d69649
commit
0e232871c4
|
|
@ -0,0 +1 @@
|
|||
__author__ = 'rzaitov'
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import unittest
|
||||
from parser.CsprojParser.Csproj import Csproj
|
||||
from parser.CsprojParser.CsprojSetting.AttribureSetting import AttributeSetting
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.csproj = Csproj('appName')
|
||||
|
||||
def test_apply(self):
|
||||
attr_value = 'parent_dir/child_dir'
|
||||
setting = AttributeSetting('rel_path', attr_value)
|
||||
|
||||
setting.apply(self.csproj)
|
||||
self.assertEqual(self.csproj.rel_path, attr_value)
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
import unittest
|
||||
from parser.CsprojParser.Csproj import Csproj
|
||||
from parser.CsprojParser.CsprojSetting.KeyValueSetting import KeyValueSetting
|
||||
|
||||
|
||||
class TestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.csproj = Csproj('appName')
|
||||
|
||||
def test_apply(self):
|
||||
|
||||
key = 'some_key'
|
||||
value = 'somve_value'
|
||||
setting = KeyValueSetting(key, value)
|
||||
|
||||
self.assertDictEqual(self.csproj.settings, {})
|
||||
|
||||
setting.apply(self.csproj)
|
||||
self.assertDictEqual(self.csproj.settings, {key: value})
|
||||
Loading…
Reference in New Issue