You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a software engineer,
I want to default the values for the TCGPrices and TCGPlayer objects,
So that there is less chance of Attribute errors.
Background:
I have noticed this exception frequently popping up; [ERROR] AttributeError: 'NoneType' object has no attribute 'reverseHolofoil'
It appears that the TCGPrices object is None so when the reverseHolofoil property is accessed it throws an exception.
Example with this issue: 'set_code': 'pop4', 'id': '1', 'name': 'Chimecho (Delta Species)'
Proposed Solution:
Default the value of the prices attribute on the TCGPrices object to a TCGPrices object with None values for normal, holofoil, etc.
Default the value of tcgplayer attribute on the Card object to a TCGPlayer object.
@dataclass
class Card():
......
tcgplayer: TCGPlayer = TCGPlayer()
@dataclass
class TCGPlayer():
....
prices: TCGPrices = TCGPrices()
Test Scenarios
GIVEN a Card object WHEN I access the tcgplayer attribute THEN the value will always be a TCGPlayer object.
GIVEN a TCGPlayer object WHEN I access the prices attribute THEN the value will always be a TCGPrices object.
The text was updated successfully, but these errors were encountered:
As a software engineer,
I want to default the values for the TCGPrices and TCGPlayer objects,
So that there is less chance of Attribute errors.
Background:
I have noticed this exception frequently popping up;
[ERROR] AttributeError: 'NoneType' object has no attribute 'reverseHolofoil'
It appears that the TCGPrices object is None so when the reverseHolofoil property is accessed it throws an exception.
Example with this issue:
'set_code': 'pop4', 'id': '1', 'name': 'Chimecho (Delta Species)'
Proposed Solution:
Default the value of the prices attribute on the TCGPrices object to a TCGPrices object with None values for normal, holofoil, etc.
Default the value of tcgplayer attribute on the Card object to a TCGPlayer object.
Test Scenarios
The text was updated successfully, but these errors were encountered: