Реализовал тесты для настроек проекта

This commit is contained in:
Rustam Zaitov 2013-10-06 19:46:34 +04:00
parent 1512d69649
commit 0e232871c4
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1 @@
__author__ = 'rzaitov'

View File

@ -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)

View File

@ -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})