def test_write_2(self):
        with patch('student_management_system.open', self.m_write_open_1):
            sms = StudentManagementSystem()
            sms.read('score.csv')
            sms.write('result.csv', 'register', 'des')

        self.m_w.write.assert_called_with(
            "3,김민식,75,85,80,240,80\n2,김광호,80,70,60,210,70\n1,강호민,85,90,95,270,90"
        )
Ejemplo n.º 2
0
from student_management_system import StudentManagementSystem

if __name__ == "__main__":
    sms = StudentManagementSystem()
    sms.read('score.csv')
    sms.write('pre_result.csv', "stotal", "des")
    sms2 = StudentManagementSystem()
    sms2.read_2('pre_result.csv')
    print(sms2.sort_2("stotal", "des"))
    sms2.write_2('result.csv', "stotal", "des")