Renamed modules: local -> locals, global -> globals
This commit is contained in:
parent
ce1da32b28
commit
5f4fc987aa
@ -18,9 +18,9 @@
|
||||
from contracts import contract
|
||||
from neat.contracts_extra import *
|
||||
|
||||
import neat.local.overload.mhod.multisize_estimation as estimation
|
||||
import neat.local.overload.mhod.bruteforce as bruteforce
|
||||
from neat.local.overload.mhod.l_2_states import ls
|
||||
import neat.locals.overload.mhod.multisize_estimation as estimation
|
||||
import neat.locals.overload.mhod.bruteforce as bruteforce
|
||||
from neat.locals.overload.mhod.l_2_states import ls
|
||||
|
||||
|
||||
@contract
|
39
tests/globals/test_manager.py
Normal file
39
tests/globals/test_manager.py
Normal file
@ -0,0 +1,39 @@
|
||||
# Copyright 2012 Anton Beloglazov
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from mocktest import *
|
||||
from pyqcy import *
|
||||
|
||||
import neat.globals.manager as manager
|
||||
|
||||
|
||||
class GlobalManager(TestCase):
|
||||
|
||||
@qc(10)
|
||||
def start(
|
||||
iterations=int_(min=0, max=10),
|
||||
time_interval=int_(min=0)
|
||||
):
|
||||
with MockTransaction:
|
||||
state = {'property': 'value'}
|
||||
config = {'local_manager_interval': time_interval}
|
||||
paths = [manager.DEFAILT_CONFIG_PATH, manager.CONFIG_PATH]
|
||||
fields = manager.REQUIRED_FIELDS
|
||||
expect(manager).read_and_validate_config(paths, fields). \
|
||||
and_return(config).once()
|
||||
expect(common).start(manager.init_state,
|
||||
manager.execute,
|
||||
config,
|
||||
time_interval).and_return(state).once()
|
||||
assert manager.start() == state
|
@ -17,8 +17,8 @@ from pyqcy import *
|
||||
|
||||
from operator import le
|
||||
|
||||
import neat.local.overload.mhod.bruteforce as b
|
||||
import neat.local.overload.mhod.nlp as nlp
|
||||
import neat.locals.overload.mhod.bruteforce as b
|
||||
import neat.locals.overload.mhod.nlp as nlp
|
||||
|
||||
|
||||
class Bruteforce(TestCase):
|
@ -15,7 +15,7 @@
|
||||
from mocktest import *
|
||||
from pyqcy import *
|
||||
|
||||
import neat.local.overload.mhod.core as c
|
||||
import neat.locals.overload.mhod.core as c
|
||||
|
||||
|
||||
class Core(TestCase):
|
@ -15,7 +15,7 @@
|
||||
from mocktest import *
|
||||
from pyqcy import *
|
||||
|
||||
import neat.local.overload.mhod.l_2_states as l
|
||||
import neat.locals.overload.mhod.l_2_states as l
|
||||
|
||||
|
||||
class L2States(TestCase):
|
@ -18,7 +18,7 @@ from pyqcy import *
|
||||
from collections import deque
|
||||
from copy import deepcopy
|
||||
|
||||
import neat.local.overload.mhod.multisize_estimation as m
|
||||
import neat.locals.overload.mhod.multisize_estimation as m
|
||||
|
||||
|
||||
def c(data):
|
@ -17,7 +17,7 @@ from pyqcy import *
|
||||
|
||||
import operator
|
||||
|
||||
import neat.local.overload.mhod.nlp as nlp
|
||||
import neat.locals.overload.mhod.nlp as nlp
|
||||
|
||||
|
||||
class Nlp(TestCase):
|
@ -15,7 +15,7 @@
|
||||
from mocktest import *
|
||||
from pyqcy import *
|
||||
|
||||
import neat.local.overload.otf as otf
|
||||
import neat.locals.overload.otf as otf
|
||||
|
||||
|
||||
class Otf(TestCase):
|
@ -15,7 +15,7 @@
|
||||
from mocktest import *
|
||||
from pyqcy import *
|
||||
|
||||
import neat.local.overload.statistics as stats
|
||||
import neat.locals.overload.statistics as stats
|
||||
|
||||
|
||||
class Statistics(TestCase):
|
@ -15,7 +15,7 @@
|
||||
from mocktest import *
|
||||
from pyqcy import *
|
||||
|
||||
import neat.local.overload.trivial as trivial
|
||||
import neat.locals.overload.trivial as trivial
|
||||
|
||||
|
||||
class Trivial(TestCase):
|
@ -20,7 +20,7 @@ import shutil
|
||||
import libvirt
|
||||
|
||||
import neat.common as common
|
||||
import neat.local.collector as collector
|
||||
import neat.locals.collector as collector
|
||||
import neat.db_utils as db_utils
|
||||
|
||||
|
@ -19,8 +19,8 @@ import shutil
|
||||
import libvirt
|
||||
|
||||
import neat.common as common
|
||||
import neat.local.collector as collector
|
||||
import neat.local.manager as manager
|
||||
import neat.locals.collector as collector
|
||||
import neat.locals.manager as manager
|
||||
|
||||
|
||||
class LocalManager(TestCase):
|
@ -15,7 +15,7 @@
|
||||
from mocktest import *
|
||||
from pyqcy import *
|
||||
|
||||
import neat.local.underload.trivial as trivial
|
||||
import neat.locals.underload.trivial as trivial
|
||||
|
||||
|
||||
class Trivial(TestCase):
|
||||
@ -30,9 +30,9 @@ class Trivial(TestCase):
|
||||
self.assertEqual(alg([0.0, 1.0]), (False, {}))
|
||||
|
||||
def test_threshold(self):
|
||||
assert trivial.threshold(0.5, []) == False
|
||||
assert trivial.threshold(0.5, [0.0, 0.0]) == True
|
||||
assert trivial.threshold(0.5, [0.0, 0.4]) == True
|
||||
assert trivial.threshold(0.5, [0.0, 0.5]) == True
|
||||
assert trivial.threshold(0.5, [0.0, 0.6]) == False
|
||||
assert trivial.threshold(0.5, [0.0, 1.0]) == False
|
||||
self.assertEqual(trivial.threshold(0.5, []), False)
|
||||
self.assertEqual(trivial.threshold(0.5, [0.0, 0.0]), True)
|
||||
self.assertEqual(trivial.threshold(0.5, [0.0, 0.4]), True)
|
||||
self.assertEqual(trivial.threshold(0.5, [0.0, 0.5]), True)
|
||||
self.assertEqual(trivial.threshold(0.5, [0.0, 0.6]), False)
|
||||
self.assertEqual(trivial.threshold(0.5, [0.0, 1.0]), False)
|
@ -15,7 +15,7 @@
|
||||
from mocktest import *
|
||||
from pyqcy import *
|
||||
|
||||
import neat.local.vm_selection.algorithms as selection
|
||||
import neat.locals.vm_selection.algorithms as selection
|
||||
|
||||
|
||||
class Selection(TestCase):
|
Loading…
x
Reference in New Issue
Block a user