implement basic version
This commit is contained in:
		
							
								
								
									
										0
									
								
								test/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								test/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										306082
									
								
								test/assets/model.obj
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										306082
									
								
								test/assets/model.obj
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										27
									
								
								test/test_obj2html.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								test/test_obj2html.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
import unittest
 | 
			
		||||
from src.obj2html import obj2html
 | 
			
		||||
import os
 | 
			
		||||
 | 
			
		||||
class TestObj2Html(unittest.TestCase):
 | 
			
		||||
    def setUp(self):
 | 
			
		||||
        self.model_assets_path = 'test/assets/model.obj'
 | 
			
		||||
 | 
			
		||||
    def test_obj2html_without_output_file_path(self):
 | 
			
		||||
        string_out = obj2html(self.model_assets_path)
 | 
			
		||||
 | 
			
		||||
        self.assertTrue(isinstance(string_out, str))
 | 
			
		||||
 | 
			
		||||
    def test_obj2html_write_html_file(self):
 | 
			
		||||
        html_path = '/tmp/index.html'
 | 
			
		||||
        if os.path.isfile(html_path):
 | 
			
		||||
            os.remove(html_path) 
 | 
			
		||||
 | 
			
		||||
        self.assertFalse(os.path.isfile(html_path))
 | 
			
		||||
        
 | 
			
		||||
        obj2html(self.model_assets_path, html_path)
 | 
			
		||||
 | 
			
		||||
        self.assertTrue(os.path.isfile(html_path))
 | 
			
		||||
        os.remove(html_path) 
 | 
			
		||||
 | 
			
		||||
if __name__ == '__main__':
 | 
			
		||||
    unittest.main()
 | 
			
		||||
		Reference in New Issue
	
	Block a user