ppf/new: Add config.py. Add skeleton functions and tests for config.py.
authorMariana Mărășoiu <mariana.marasoiu@gmail.com>
Wed, 24 Aug 2011 18:15:03 +0000 (21:15 +0300)
committerMariana Mărășoiu <mariana.marasoiu@gmail.com>
Wed, 24 Aug 2011 18:15:03 +0000 (21:15 +0300)
ppf/new/config.py [new file with mode: 0644]
ppf/new/tests/test_config.py [new file with mode: 0644]

diff --git a/ppf/new/config.py b/ppf/new/config.py
new file mode 100644 (file)
index 0000000..98a30fe
--- /dev/null
@@ -0,0 +1,90 @@
+"""
+Configuration class for P2P logging information.
+
+2011, Mariana Marasoiu, mariana.marasoiu@gmail.com
+"""
+
+import os
+import os.path
+import logging
+
+#
+# Logging code heavily inspired by Logging HOWTO documentation:
+#     http://docs.python.org/dev/howto/logging.html#configuring-logging
+#
+
+# Create logger; default logging level is DEBUG.
+logger = logging.getLogger(__name__)
+logger.setLevel(logging.DEBUG)
+
+# Create console handler and set level to ERROR.
+ch = logging.StreamHandler()
+ch.setLevel(logging.DEBUG)
+
+# Create formatter.
+formatter = logging.Formatter('%(filename)s:%(lineno)s - %(levelname)s: %(message)s')
+
+# Add formatter to console handler.
+ch.setFormatter(formatter)
+
+# Add console handler to logger.
+logger.addHandler(ch)
+
+
+class SwarmConfig(object):
+    def __init__(self):
+        pass
+
+    def load(self, ini_file):
+        pass
+
+    def store(self, ini_file):
+        pass
+        
+    def add(self, section, option, value):
+        pass
+
+    def get(self, section):
+        pass
+
+    def set(self, section, option, value):
+        pass
+
+class SessionConfig(object):
+    def __init__(self):
+        pass
+
+    def load(self, ini_file):
+        pass
+
+    def store(self, ini_file):
+        pass
+        
+    def add(self, section, option, value):
+        pass
+
+    def get(self, section):
+        pass
+
+    def set(self, section, option, value):
+        pass
+
+class AccessConfig(object):
+    def __init__(self):
+        pass
+
+    def load(self, ini_file):
+        pass
+
+    def store(self, ini_file):
+        pass
+        
+    def add(self, section, option, value):
+        pass
+
+    def get(self, section):
+        pass
+
+    def set(self, section, option, value):
+        pass
+
diff --git a/ppf/new/tests/test_config.py b/ppf/new/tests/test_config.py
new file mode 100644 (file)
index 0000000..bc30a78
--- /dev/null
@@ -0,0 +1,73 @@
+"""
+Test suite for config. Uses unittest module.
+
+2011, Mariana Marasoiu, mariana.marasoiu@gmail.com
+"""
+
+import unittest
+import os
+import os.path
+import shutil
+import sys
+
+import config
+
+class SwarmConfigTest(object):
+    """
+    Test suite for SwarmConfig class in config.py.
+    """
+    def setUp(self)
+        pass
+
+    def tearDown(self)
+        pass
+
+    def test_add(self):
+        pass
+
+    def test_get(self):
+        pass
+
+    def test_other(self):
+        pass
+        
+class SessionConfigTest(object):
+    """
+    Test suite for AccessConfig class in config.py.
+    """
+    def setUp(self)
+        pass
+
+    def tearDown(self)
+        pass
+
+    def test_add(self):
+        pass
+
+    def test_get(self):
+        pass
+
+    def test_other(self):
+        pass
+
+class AccessConfigTest(object):
+    """
+    Test suite for AccessConfig class in config.py.
+    """
+    def setUp(self)
+        pass
+
+    def tearDown(self)
+        pass
+
+    def test_add(self):
+        pass
+
+    def test_get(self):
+        pass
+
+    def test_other(self):
+        pass
+
+if __name__ == "__main__":
+    unittest.main()