Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
data = {
self.session_name: {
'type': self.odoo.__class__.__name__,
'server': self.odoo.server,
'protocol': self.odoo.protocol,
'port': int(self.odoo.port),
'timeout': self.odoo.config['timeout'],
'user': self.odoo.user.login,
'passwd': self.odoo._password,
'database': self.odoo.db,
}
}
result = odoorpc.tools.session.get_all(rc_file=self.file_path)
self.assertIn(self.session_name, result)
self.assertEqual(data, result)
odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)
def test_session_tools_get(self):
self.odoo.save(self.session_name, rc_file=self.file_path)
data = {
'type': self.odoo.__class__.__name__,
'server': self.odoo.server,
'protocol': self.odoo.protocol,
'port': int(self.odoo.port),
'timeout': self.odoo.config['timeout'],
'user': self.odoo.user.login,
'passwd': self.odoo._password,
'database': self.odoo.db,
}
result = odoorpc.tools.session.get(
self.session_name, rc_file=self.file_path)
self.assertEqual(data, result)
odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)
def test_session_odoo_save_and_remove(self):
self.odoo.save(self.session_name, rc_file=self.file_path)
result = odoorpc.ODOO.list(rc_file=self.file_path)
self.assertIn(self.session_name, result)
odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)
def test_session_tools_get(self):
self.odoo.save(self.session_name, rc_file=self.file_path)
data = {
'type': self.odoo.__class__.__name__,
'server': self.odoo.server,
'protocol': self.odoo.protocol,
'port': int(self.odoo.port),
'timeout': self.odoo.config['timeout'],
'user': self.odoo.user.login,
'passwd': self.odoo._password,
'database': self.odoo.db,
}
result = odoorpc.tools.session.get(
self.session_name, rc_file=self.file_path)
self.assertEqual(data, result)
odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)
def test_session_odoo_save_and_remove(self):
self.odoo.save(self.session_name, rc_file=self.file_path)
result = odoorpc.ODOO.list(rc_file=self.file_path)
self.assertIn(self.session_name, result)
odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)
def test_session_odoo_load(self):
self.odoo.save(self.session_name, rc_file=self.file_path)
odoo = odoorpc.ODOO.load(self.session_name, rc_file=self.file_path)
self.assertIsInstance(odoo, odoorpc.ODOO)
self.assertEqual(self.odoo.server, odoo.server)
self.assertEqual(self.odoo.port, odoo.port)
self.assertEqual(self.odoo.db, odoo.db)
self.assertEqual(self.odoo.protocol, odoo.protocol)
self.assertEqual(self.odoo.user, odoo.user)
odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)
data = {
self.session_name: {
'type': self.odoo.__class__.__name__,
'server': self.odoo.server,
'protocol': self.odoo.protocol,
'port': int(self.odoo.port),
'timeout': self.odoo.config['timeout'],
'user': self.odoo.user.login,
'passwd': self.odoo._password,
'database': self.odoo.db,
}
}
result = odoorpc.tools.session.get_all(rc_file=self.file_path)
self.assertIn(self.session_name, result)
self.assertEqual(data, result)
odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)
def test_session_odoo_load(self):
self.odoo.save(self.session_name, rc_file=self.file_path)
odoo = odoorpc.ODOO.load(self.session_name, rc_file=self.file_path)
self.assertIsInstance(odoo, odoorpc.ODOO)
self.assertEqual(self.odoo.server, odoo.server)
self.assertEqual(self.odoo.port, odoo.port)
self.assertEqual(self.odoo.db, odoo.db)
self.assertEqual(self.odoo.protocol, odoo.protocol)
self.assertEqual(self.odoo.user, odoo.user)
odoorpc.ODOO.remove(self.session_name, rc_file=self.file_path)