文件操作 - test_core.cpython-310.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/automat/_test/__pycache__/test_core.cpython-310.pyc
编辑文件内容
o ��P] � @ s0 d dl mZmZ ddlmZ G dd� de�ZdS )� )� Automaton�NoTransition� )�TestCasec @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� ZdS ) � CoreTestszN Tests for Automat's (currently private, implementation detail) core. c C sv | � t�� t� W d � n1 sw Y d}d}t||d�}| �|j|� | �|t|�� | �|t|�� dS )zj A L{NoTransition} exception describes the state and input symbol that caused it. Nz current-stateztransitionless-symbol)�state�symbol)�assertRaises� TypeErrorr �assertIsr �assertIn�str)�selfr r �noTransitionException� r �9/usr/lib/python3/dist-packages/automat/_test/test_core.py�test_NoTransition s �zCoreTests.test_NoTransitionc C s t � }| �t|jdd� dS )zx L{Automaton.outputForInput} raises L{NoTransition} if no transition for that input is defined. zno-statez no-symbolN)r r r �outputForInput�r �ar r r �test_noOutputForInput s �zCoreTests.test_noOutputForInputc C sn t � }|�ddddg� | �|�� dh� | �|�� dh� | �|�dd�ddgf� | �|�� ddh� dS )a L{Automaton.addTransition} adds its input symbol to L{Automaton.inputAlphabet}, all its outputs to L{Automaton.outputAlphabet}, and causes L{Automaton.outputForInput} to start returning the new state and output symbols. � beginning�begin�ending�endN)r � addTransition�assertEqual� inputAlphabet�outputAlphabetr �statesr r r r �test_oneTransition( s �zCoreTests.test_oneTransitionc C s\ t � }d}| �t|jddd|� | �|�� � | �|�� � | �|�� � | �|�� � dS )z� L{Automaton.addTransition} raises a TypeError when given outputs that aren't iterable and doesn't add any transitions. � � fromState� viaSymbol�toStateN) r r r r �assertFalser r r �allTransitions)r r �nonIterableOutputsr r r �%test_oneTransition_nonIterableOutputs8 s �z/CoreTests.test_oneTransition_nonIterableOutputsc C sP t � }d|_| �|jd� | �t�� d|_W d � dS 1 s!w Y dS )z� L{Automaton.initialState} is a descriptor that sets the initial state if it's not yet set, and raises L{ValueError} if it is. za statez another stateN)r �initialStater r � ValueErrorr r r r �test_initialStateI s "�zCoreTests.test_initialStateN) �__name__� __module__�__qualname__�__doc__r r r r( r+ r r r r r s r N)�_corer r �unittestr r r r r r �<module> s
修改文件时间
将文件时间修改为当前时间的前一年
删除文件