def testCase1(self): input_arr = [('', self._css_1), ('', self._css_2)] expected = """ /*Not Empty*/ .s1 { color: red; background: url(assets/image/loading-32c198278c026985bc8ece35bf38546f.gif) } .s2 { font-size: 12px; background: url(assets/image/esui-9eefceb966b0922c9b22526bb8555f21.png) } """ new_code = merge_compile_rewrite(input_arr, self._less_include_path, self._am) self.assertEquals(expected.strip(), new_code.strip()) self.assertTrue(os.path.exists(os.path.join(self._output_dir, "assets/image/loading-32c198278c026985bc8ece35bf38546f.gif"))) self.assertTrue(os.path.exists(os.path.join(self._output_dir, "assets/image/esui-9eefceb966b0922c9b22526bb8555f21.png")))
def testCase2(self): input_arr = [('', self._less_1), ('', self._less_2)] expected = """ /*Not Empty*/ .jn-warning { color: #ff9a00; font-size: 12px } .jn-row { line-height: 24px } .jn-row span, .jn-row .ui-text { float: left; margin-right: 10px } """ new_code = merge_compile_rewrite(input_arr, self._less_include_path, self._am) self.assertEquals(expected.strip(), new_code.strip())
def testCase3(self): input_arr = [('', self._less_with_import_1), ('', self._less_with_import_2)] expected = """ /*Not Empty*/ .system-s1 { font-family: Arial } .base-s1 { height: 100px } .ls1 { color: #333 } .common-s1 { font-weight: bold } .ls2 { color: #333; opacity: 0.9 } """ new_code = merge_compile_rewrite(input_arr, self._less_include_path, self._am) self.assertEquals(expected.strip(), new_code.strip())