File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+ import os
4
+ import unittest
5
+
6
+ from classifier import classifier as clf
7
+
8
+
9
+ class ClassifierTest (unittest .TestCase ):
10
+
11
+ __location = os .path .realpath (
12
+ os .path .join (os .getcwd (), os .path .dirname (__file__ )))
13
+
14
+ __tmp_file_name = '.classifier_test'
15
+
16
+ def test_moveto (self ):
17
+ os .chdir (self .__location )
18
+ tmp_file = open (self .__tmp_file_name , 'w' )
19
+
20
+ parent_dir = os .path .abspath (os .path .join (self .__location , os .pardir ))
21
+ clf .moveto (self .__tmp_file_name , self .__location , parent_dir )
22
+
23
+ final_file_path = os .path .join (parent_dir , self .__tmp_file_name )
24
+ self .assertTrue (os .path .exists (final_file_path ))
25
+ os .remove (final_file_path )
26
+
27
+ if __name__ == '__main__' :
28
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments