GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — burncode/tests/test_pet_cats_catalog.py at main · burncode/burncode

Expand file tree

/

test_pet_cats_catalog.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
54 lines (47 loc) · 2.81 KB
/

test_pet_cats_catalog.py

Copy path

File metadata and controls

54 lines (47 loc) · 2.81 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import copy
import unittest
from pathlib import Path
from xml.etree import ElementTree as ET
import build
from profilegen.components import companion
from profilegen.svg import Canvas
ROOT=Path(__file__).resolve().parents[1]
class FullCatalogTests(unittest.TestCase):
def test_all_six_cats_and_native_actions_are_configurable(self):
self.assertEqual(len(companion.CHARACTERS),6)
for character in companion.CHARACTERS:
for action in companion.ACTIONS:
if character=='classic_cat' and action=='itch':continue
cfg=build.read_json(ROOT/'config.json')
cfg['companion']={'character':character,'animation':action}
checked=build.validate(cfg,ROOT/'config.json')
canvas=Canvas(build.load_theme('paper'))
companion.render(canvas,0,checked)
root=ET.fromstring('<svg>'+''.join(canvas.parts)+'</svg>')
ids={n.get('id') for n in root.iter() if n.get('id')}
self.assertTrue(all(not any(c.isspace() for c in ident) for ident in ids))
self.assertTrue(all(n.get('href')[1:] in ids for n in root.iter('use')))
def test_banner_can_be_selected_without_story(self):
canvas=Canvas(build.load_theme('paper'))
companion.render(canvas,0,{'companion':{'animation':'banner','banner':'Hi'}})
root=ET.fromstring('<svg>'+''.join(canvas.parts)+'</svg>')
self.assertEqual(root.find('.//g[@id="companion-banner"]/text').text,'Hi')
def test_one_shot_actions_freeze_on_final_frame(self):
for action in ('lay_down','stretch'):
canvas=Canvas(build.load_theme('paper'))
companion.render(canvas,0,{'companion':{'animation':action}})
root=ET.fromstring('<svg>'+''.join(canvas.parts)+'</svg>')
animations=root.findall('.//use/animate')
self.assertTrue(animations)
self.assertTrue(all(a.get('repeatCount')=='1' and a.get('fill')=='freeze' for a in animations))
def test_auto_outline_only_on_dark_theme_black_cat_and_can_be_disabled(self):
for theme,outline,expected in [('paper','auto',False),('violet','auto',True),('violet','off',False),('paper','on',True)]:
canvas=Canvas(build.load_theme(theme))
companion.render(canvas,0,{'companion':{'character':'tuxedo_cat','animation':'walk','outline':outline}})
root=ET.fromstring('<svg>'+''.join(canvas.parts)+'</svg>')
self.assertEqual(bool(root.findall('.//path[@data-role="contrast-outline"]')),expected)
def test_missing_original_itch_is_reported(self):
cfg=build.read_json(ROOT/'config.json')
cfg['companion']={'character':'classic_cat','animation':'itch'}
with self.assertRaisesRegex(build.ConfigError,'Itch'):
build.validate(cfg,ROOT/'config.json')
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.