Remove crap nosetests for yaml_fs
Signed-off-by: martin f. krafft <madduck@madduck.net>
diff --git a/reclass/storage/yaml_fs/tests/classes/basenode.yml b/reclass/storage/yaml_fs/tests/classes/basenode.yml
deleted file mode 100644
index d9d997a..0000000
--- a/reclass/storage/yaml_fs/tests/classes/basenode.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-applications:
-- motd
-- firewall
-parameters:
- realm: madduck.net
diff --git a/reclass/storage/yaml_fs/tests/classes/debiannode.yml b/reclass/storage/yaml_fs/tests/classes/debiannode.yml
deleted file mode 100644
index 84837ff..0000000
--- a/reclass/storage/yaml_fs/tests/classes/debiannode.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-classes:
-- basenode
-applications:
-- apt
-parameters:
- apt:
- mirror_base: http://http.debian.net
diff --git a/reclass/storage/yaml_fs/tests/classes/debiannode@sid.yml b/reclass/storage/yaml_fs/tests/classes/debiannode@sid.yml
deleted file mode 100644
index 806612a..0000000
--- a/reclass/storage/yaml_fs/tests/classes/debiannode@sid.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-classes:
-- debiannode
-parameters:
- debian_codename: sid
diff --git a/reclass/storage/yaml_fs/tests/classes/debiannode@squeeze.yml b/reclass/storage/yaml_fs/tests/classes/debiannode@squeeze.yml
deleted file mode 100644
index 08075b5..0000000
--- a/reclass/storage/yaml_fs/tests/classes/debiannode@squeeze.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-classes:
-- debiannode
-parameters:
- debian_codename: squeeze
diff --git a/reclass/storage/yaml_fs/tests/classes/debiannode@wheezy.yml b/reclass/storage/yaml_fs/tests/classes/debiannode@wheezy.yml
deleted file mode 100644
index 5ced15a..0000000
--- a/reclass/storage/yaml_fs/tests/classes/debiannode@wheezy.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-classes:
-- debiannode
-parameters:
- debian_codename: wheezy
diff --git a/reclass/storage/yaml_fs/tests/classes/hosted@munich.yml b/reclass/storage/yaml_fs/tests/classes/hosted@munich.yml
deleted file mode 100644
index 1d14dad..0000000
--- a/reclass/storage/yaml_fs/tests/classes/hosted@munich.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-parameters:
- location: munich
- apt:
- mirror_base: uni-erlangen
diff --git a/reclass/storage/yaml_fs/tests/classes/hosted@zurich.yml b/reclass/storage/yaml_fs/tests/classes/hosted@zurich.yml
deleted file mode 100644
index 050af27..0000000
--- a/reclass/storage/yaml_fs/tests/classes/hosted@zurich.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-parameters:
- location: zurich
- apt:
- mirror_base: switch
diff --git a/reclass/storage/yaml_fs/tests/classes/mailserver.yml b/reclass/storage/yaml_fs/tests/classes/mailserver.yml
deleted file mode 100644
index 37d6673..0000000
--- a/reclass/storage/yaml_fs/tests/classes/mailserver.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-applications:
-- postfix
-parameters:
- firewall:
- openport: 25/tcp
diff --git a/reclass/storage/yaml_fs/tests/classes/subdir/subclass.yml b/reclass/storage/yaml_fs/tests/classes/subdir/subclass.yml
deleted file mode 100644
index e69de29..0000000
--- a/reclass/storage/yaml_fs/tests/classes/subdir/subclass.yml
+++ /dev/null
diff --git a/reclass/storage/yaml_fs/tests/classes/webserver.yml b/reclass/storage/yaml_fs/tests/classes/webserver.yml
deleted file mode 100644
index 5db36ff..0000000
--- a/reclass/storage/yaml_fs/tests/classes/webserver.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-applications:
-- lighttpd
-parameters:
- firewall:
- openport: 80/tcp
diff --git a/reclass/storage/yaml_fs/tests/nodes/blue.yml b/reclass/storage/yaml_fs/tests/nodes/blue.yml
deleted file mode 100644
index 31b7a23..0000000
--- a/reclass/storage/yaml_fs/tests/nodes/blue.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-classes:
-- debiannode@squeeze
-- hosted@munich
-- mailserver
-- webserver
-applications:
-- blues
-parameters:
- motd:
- greeting: This node is $nodename
- colour: blue
diff --git a/reclass/storage/yaml_fs/tests/nodes/empty.yml b/reclass/storage/yaml_fs/tests/nodes/empty.yml
deleted file mode 100644
index e69de29..0000000
--- a/reclass/storage/yaml_fs/tests/nodes/empty.yml
+++ /dev/null
diff --git a/reclass/storage/yaml_fs/tests/nodes/green.yml b/reclass/storage/yaml_fs/tests/nodes/green.yml
deleted file mode 100644
index 1f3d6d6..0000000
--- a/reclass/storage/yaml_fs/tests/nodes/green.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-classes:
-- debiannode@wheezy
-- hosted@zurich
-- mailserver
-applications:
-- ~firewall
-parameters:
- motd:
- greeting: This node is $nodename
- colour: green
diff --git a/reclass/storage/yaml_fs/tests/nodes/null.yml b/reclass/storage/yaml_fs/tests/nodes/null.yml
deleted file mode 100644
index eae0e02..0000000
--- a/reclass/storage/yaml_fs/tests/nodes/null.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-classes:
-applications: # null-value must be handled
-parameters:
diff --git a/reclass/storage/yaml_fs/tests/nodes/red.yml b/reclass/storage/yaml_fs/tests/nodes/red.yml
deleted file mode 100644
index 051d0f5..0000000
--- a/reclass/storage/yaml_fs/tests/nodes/red.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-classes:
-- debiannode@sid
-- hosted@zurich
-- webserver
-parameters:
- apt: # null-value must not override inherited dictionary
- motd:
- greeting: This node is $nodename
- colour: red
diff --git a/reclass/storage/yaml_fs/tests/test_directory.py b/reclass/storage/yaml_fs/tests/test_directory.py
deleted file mode 100644
index 9d6049d..0000000
--- a/reclass/storage/yaml_fs/tests/test_directory.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# -*- coding: utf-8 -*-
-#
-# This file is part of reclass (http://github.com/madduck/reclass)
-#
-# Copyright © 2007–13 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-from reclass.storage.yaml_fs import directory
-import os, sys
-
-TESTDIR = os.path.join(sys.path[0], 'classes')
-FILECOUNT = 10
-
-class TestDirectory:
-
- def setUp(self):
- self._dir = directory.Directory(TESTDIR)
-
- def test_walk_registry(self):
- def count_fn(d, f):
- count_fn.c += len(f)
- count_fn.c = 0
- self._dir.walk(register_fn=count_fn)
- assert count_fn.c == FILECOUNT
-
- def test_walk(self):
- self._dir.walk()
- assert len(self._dir.files) == FILECOUNT
-
diff --git a/reclass/storage/yaml_fs/tests/test_yaml_fs.py b/reclass/storage/yaml_fs/tests/test_yaml_fs.py
deleted file mode 100644
index cb97fdd..0000000
--- a/reclass/storage/yaml_fs/tests/test_yaml_fs.py
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# -*- coding: utf-8 -*-
-#
-# This file is part of reclass (http://github.com/madduck/reclass)
-#
-# Copyright © 2007–13 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-from reclass.storage.yaml_fs import ExternalNodeStorage
-
-import os
-
-POSTFIX = '_hosts'
-PWD = os.path.dirname(__file__)
-HOSTS = ['red', 'blue', 'green']
-APPLICATIONS = {'apt': HOSTS,
- 'motd': HOSTS,
- 'firewall': HOSTS[:2],
- 'lighttpd': HOSTS[:2],
- 'postfix': HOSTS[1:],
- 'blues': HOSTS[1:2]
- }
-CLASSES = {'basenode': HOSTS,
- 'debiannode': HOSTS,
- 'debiannode@sid': HOSTS[0:1],
- 'debiannode@wheezy': HOSTS[2:3],
- 'debiannode@squeeze': HOSTS[1:2],
- 'hosted@munich': HOSTS[1:2],
- 'hosted@zurich': [HOSTS[0], HOSTS[2]],
- 'mailserver': HOSTS[1:],
- 'webserver': HOSTS[:2]
- }
-
-class TestYamlFs:
-
- def setUp(self):
- self._storage = ExternalNodeStorage(os.path.join(PWD, 'nodes'),
- os.path.join(PWD, 'classes'))
- self._inventory = self._storage.inventory()
-
- def test_inventory_setup(self):
- assert isinstance(self._inventory, dict)
- assert 'applications' in self._inventory
- assert 'classes' in self._inventory
-
- def test_inventory_applications(self):
- assert len(self._inventory['applications']) == len(APPLICATIONS)
- for i in APPLICATIONS.iterkeys():
- assert i in self._inventory['applications']
- for app, members in self._inventory['applications'].iteritems():
- for i in APPLICATIONS[app]:
- assert i in members
- for app, members in APPLICATIONS.iteritems():
- for i in self._inventory['applications'][app]:
- assert i in members
-
- def test_inventory_classes(self):
- assert len(self._inventory['classes']) == len(CLASSES)
- for i in CLASSES.iterkeys():
- assert i in self._inventory['classes']
- for klass, members in self._inventory['classes'].iteritems():
- for i in CLASSES[klass]:
- assert i in members
- for klass, members in CLASSES.iteritems():
- for i in self._inventory['classes'][klass]:
- assert i in members
-
- def test_host_meta(self):
- for n in HOSTS:
- node = self._storage.nodeinfo(n)
- assert '__reclass__' in node
-
- def test_host_entities(self):
- for n in HOSTS:
- node = self._storage.nodeinfo(n)
- assert 'applications' in node
- assert 'classes' in node
- assert 'parameters' in node
-
- def test_merge_empty_dict(self):
- node = self._storage.nodeinfo(HOSTS[0])
- assert 'apt' in node['parameters']
- assert node['parameters']['apt'] is not None
-
- def test_merge_parameters(self):
- node = self._storage.nodeinfo(HOSTS[1])
- assert node['parameters']['apt']['mirror_base'] == 'uni-erlangen'
diff --git a/reclass/storage/yaml_fs/tests/test_yamlfile.py b/reclass/storage/yaml_fs/tests/test_yamlfile.py
deleted file mode 100644
index fe34396..0000000
--- a/reclass/storage/yaml_fs/tests/test_yamlfile.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# -*- coding: utf-8 -*-
-#
-# This file is part of reclass (http://github.com/madduck/reclass)
-#
-# Copyright © 2007–13 martin f. krafft <madduck@madduck.net>
-# Released under the terms of the Artistic Licence 2.0
-#
-from reclass.storage.yaml_fs import yamlfile
-import os, sys
-from reclass.datatypes import Entity, Classes, Parameters, Applications
-
-TESTFILE = os.path.join(sys.path[0], 'nodes', 'blue.yml')
-EMPTYFILE = os.path.join(sys.path[0], 'nodes', 'empty.yml')
-NULLFILE = os.path.join(sys.path[0], 'nodes', 'null.yml')
-
-class TestYamlFile:
-
- def setUp(self):
- self._file = yamlfile.YamlFile(TESTFILE)
-
- def test_path_property(self):
- assert self._file.path == TESTFILE
-
- def test_data(self):
- e = self._file.entity
- c = e.classes
- assert len(c) == 4
- assert hasattr(c, 'merge')
- p = e.parameters
- assert len(p) == 2
- assert 'motd' in p
- assert 'colour' in p
- assert hasattr(p, 'merge')
- a = e.applications
- assert len(a) == 1
- assert 'blues' in a
- assert hasattr(a, 'merge')
-
- def test_empty_file(self):
- e = yamlfile.YamlFile(EMPTYFILE).entity
- assert isinstance(e, Entity)
- assert isinstance(e.classes, Classes)
- assert len(e.classes) == 0
- assert isinstance(e.parameters, Parameters)
- assert len(e.parameters) == 0
- assert isinstance(e.applications, Applications)
- assert len(e.applications) == 0
-
- def test_null_file(self):
- e = yamlfile.YamlFile(NULLFILE).entity
- assert isinstance(e, Entity)
- assert isinstance(e.classes, Classes)
- assert len(e.classes) == 0
- assert isinstance(e.parameters, Parameters)
- assert len(e.parameters) == 0
- assert isinstance(e.applications, Applications)
- assert len(e.applications) == 0