MCPcopy Index your code
hub / github.com/bugy/script-server / User

Class User

src/auth/user.py:5–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4
5class User:
6 def __init__(self, user_id, audit_names):
7 self.audit_names = audit_names
8 self.user_id = user_id
9
10 def get_audit_name(self):
11 return audit_utils.get_audit_name(self.audit_names)
12
13 def get_username(self):
14 return self.audit_names.get(AUTH_USERNAME)
15
16 def __str__(self) -> str:
17 if AUTH_USERNAME in self.audit_names:
18 return self.audit_names.get(AUTH_USERNAME)
19
20 return str(self.audit_names)
21
22 def as_serializable_dict(self):
23 return {
24 'user_id': self.user_id,
25 'audit_names': self.audit_names
26 }
27
28 def __eq__(self, o: object) -> bool:
29 return isinstance(o, User) and (self.user_id == o.user_id)
30
31
32def from_serialized_dict(dict):

Calls

no outgoing calls

Tested by 15

test_logging_valuesMethod · 0.72
test_exit_codeMethod · 0.72
perform_executionMethod · 0.72
tearDownMethod · 0.72
_start_with_configMethod · 0.72
test_stop_scriptMethod · 0.72
test_kill_scriptMethod · 0.72
test_is_runningMethod · 0.72
test_get_configMethod · 0.72
test_cleanupMethod · 0.72