Пофиксил тесты

This commit is contained in:
rzaitov 2013-11-13 17:28:29 +04:00
parent 94aea27f50
commit 2e1ec00ec7
7 changed files with 57 additions and 26 deletions

View File

@ -1,16 +1,18 @@
sh echo 'IosSetupSteps.txt'
# restore from backup # восстанавливаем из бэкапа (исходники от сборки предыдущей конфигурации могут быть модифицированными)
# create backup
sh echo '{@sln_config}'
#sh echo '{@sln_config}'
inside 'BuildSample/BuildSample.sln' remove NotCompileApp project
#inside 'BuildSample/BuildSample.sln' remove NotCompileApp project
inside 'BuildSample/BuildSample/CoolApp.csproj' set OutputPath to 'Output' for '{@sln_config}'
inside 'BuildSample/BuildSample/CoolApp.csproj' set AssemblyName to 'CoolApp' for ''
#inside 'BuildSample/BuildSample/CoolApp.csproj' set OutputPath to 'Output' for '{@sln_config}'
#inside 'BuildSample/BuildSample/CoolApp.csproj' set AssemblyName to 'CoolApp' for ''
inside 'BuildSample/BuildSample/Info.plist' set CFBundleVersion to '{@version}'
inside 'BuildSample/BuildSample/Info.plist' set CFBundleDisplayName to 'CoolApp'
#inside 'BuildSample/BuildSample/Info.plist' set CFBundleVersion to '{@version}'
#inside 'BuildSample/BuildSample/Info.plist' set CFBundleDisplayName to 'CoolApp'
inside 'BuildSample/BuildSample/Info.plist' set CFBundleIconFiles with values '{@icons}'
#inside 'BuildSample/BuildSample/Info.plist' set CFBundleIconFiles with values '{@icons}'
install profile 'BuildSample/BuildSample/Profiles/8F606DAE-F9C9-4A19-8EFF-34B990D76C28.mobileprovision'
#install profile 'BuildSample/BuildSample/Profiles/8F606DAE-F9C9-4A19-8EFF-34B990D76C28.mobileprovision'

View File

@ -1,9 +1,10 @@
sh echo '{@builder_path}'
sh echo 'IosSteps.txt'
#sh echo '{@builder_path}'
<include 'scripts/{@setup_steps}'>
sh echo hello from '{@author}'
sh echo version: '{@version}'
#sh echo hello from '{@author}'
#sh echo version: '{@version}'
#clean 'BuildSample/BuildSample.sln' for '{@sln_config}'
#build 'BuildSample/BuildSample.sln' for '{@sln_config}'

View File

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

View File

@ -0,0 +1,37 @@
import unittest
from parsers.SettingsParser.SettingsMerger import SettingsMerger
class TestSettingsMerger(unittest.TestCase):
def setUp(self):
self.merger = SettingsMerger()
self.globalSettings = {
'top_level_key1': 'value1',
'top_level_key2': 'value2',
'child1': {
'sub_key1': 'value3',
'sub_key2': 'value4',
},
'child2': {
'sub_key3': 'value5',
'sub_key4': 'value6',
}
}
settingDescr2 = {
'segments': ['child1', 'sub_key1'],
'value': 'new_value3'
}
def test_mergeTopLevelSettings(self):
description = {
'segments': ['top_level_key1'],
'value': 'new_value1'
}
self.merger.merge(self.globalSettings, description)
self.assertEqual('new_value1', self.globalSettings['top_level_key1'])
self.assertEqual('value2', self.globalSettings['top_level_key2'])

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import unittest
from Core.LineConveyor.NullPreprocessor import NullPreprocessor
from parsers.SettingsParser.SettingsParser import SettingsParser
@ -48,7 +49,6 @@ class TestSettingsParser(unittest.TestCase):
def processLine(self, line):
self.processLineCall += 1
print '{0} {1}'.format(self.processLineCall, line)
self.parser = PartialSettingsParser(self.preprocessor)
content = """
@ -62,7 +62,7 @@ valid.line.with.setting = 'some value'
# всего 6 строк, 2 из которых пустые
# NullPreprocessor не уберет комментарии, поэтому будет 4 вызова processLine
self.assertEqual(2, self.parser.processLineCall)
self.assertEqual(4, self.parser.processLineCall)

View File

@ -10,8 +10,6 @@ class SettingsMerger:
propName = segments[-1]
settingsDict = self.getSettingsDictByPath(globalSettings, propPath)
#self.overrideGuard(settingsDict, propName, propPath)
settingsDict[propName] = value
def getSettingsDictByPath(self, globalSettings, pathToSettingsDict):
@ -24,12 +22,4 @@ class SettingsMerger:
settingsDict = settingsDict[segment]
return settingsDict
#def overrideGuard(self, dictionary, key, path):
# if key in dictionary:
# pathStr = '.'.join(path)
# msg = 'settings with name {0} by path {1} already exists with value {3}'.format(key, dictionary[key], pathStr)
# raise Exception(msg)
return settingsDict

View File

@ -7,9 +7,9 @@ class SettingsParser:
assert compositeLineProcessor is not None
self.compositeLineProcessor = compositeLineProcessor
self.settings = settings
if not self.settings:
self.settings = settings
if self.settings is None:
self.settings = {}
def parse(self, content):