-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first pass at adding a class to capture the stats of traces, called T…
…race_Call__Stats
- Loading branch information
Showing
7 changed files
with
59 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from osbot_utils.base_classes.Kwargs_To_Self import Kwargs_To_Self | ||
|
||
|
||
class Trace_Call__Stats(Kwargs_To_Self): | ||
|
||
event_call : int | ||
event_return: int | ||
|
||
def __repr__(self): | ||
return str(self.__locals__()) | ||
|
||
def __eq__(self, target): | ||
if self is target: | ||
return True | ||
return self.__locals__() == target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from unittest import TestCase | ||
|
||
from osbot_utils.utils.trace.Trace_Call__Stats import Trace_Call__Stats | ||
|
||
|
||
class test_Trace_Call_Stats(TestCase): | ||
|
||
def setUp(self): | ||
self.trace_call_stats = Trace_Call__Stats() | ||
|
||
def test___kwargs__(self): | ||
expected_locals = dict(event_call = 0 , | ||
event_return = 0 ) | ||
|
||
assert Trace_Call__Stats.__cls_kwargs__ () == expected_locals | ||
assert Trace_Call__Stats.__default_kwargs__() == expected_locals | ||
assert Trace_Call__Stats().__kwargs__ () == expected_locals | ||
assert Trace_Call__Stats().__locals__ () == expected_locals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters