Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Unit test

  • Loading branch information...
commit c1b96ac31f8526a35a558675f22d04049b4dbac6 1 parent 4cbf6f2
@mjirik authored
Showing with 24 additions and 1 deletion.
  1. +0 −1  src/classif.py
  2. +24 −0 src/utest.py
View
1  src/classif.py
@@ -49,7 +49,6 @@ class Clf:
ClfFeatVec = None
def __init__(self):
- print 'Clf init'
self.ClfInit = svm.SVC()
self.ClfTrain = self.ClfInit.fit
self.ClfPredict = self.ClfInit.predict
View
24 src/utest.py
@@ -0,0 +1,24 @@
+#! /usr/bin/ipython
+# -*- coding: utf-8 -*-
+import sys
+sys.path.append("./../src/")
+sys.path.append("./")
+import unittest
+
+class TestSequenceFunctions(unittest.TestCase):
+ def test_xxx(self):
+ #assert(1 == 2)
+ pass
+
+ def test_classif_Clf(self):
+ ''' Classifer test'''
+ import classif
+
+ clf = classif.Clf()
+ clf.ClfTrain([[2],[5],[9],[4]],[0,1,2,1])
+ prediction2 = clf.ClfPredict([[2],[4],[8]])
+ sumErr = sum (prediction2 != [0 , 1 , 2])
+ assert (sumErr == 0)
+
+if __name__ == '__main__':
+ unittest.main()
Please sign in to comment.
Something went wrong with that request. Please try again.