<commit_before><?php

namespace Aws\Tests;

class Ec2MetadataTest extends \PHPUnit_Framework_TestCase
{

    private $dummyMetadata = [
            'ami-id' => 'ami-12345678',
            'ami-launch-index' => '0',
            'ami-manifest-path' => '(unknown)',
            'block-device-mapping' => [
                    'ebs0' => 'sda',
                    'ephemeral0' => 'sdb',
                    'root' => '/dev/sda1'
            ],
            'hostname' => 'ip-10-123-123-123.ap-northeast-1.compute.internal',
            'instance-id' => 'i-87654321',
            'instance-type' => 't1.micro',
            'local-hostname' => 'ip-10-123-123-123.ap-northeast-1.compute.internal',
            'local-ipv4' => '10.123.123.123',
            'kernel-id' => 'aki-12345678',
            'placement' => 'ap-northeast-1c',
            'product-codes' => 'abcdefghijklmnopqrstuvwxy',
            'public-hostname' => 'ec2-12-34-56-78.ap-northeast-1.compute.amazonaws.com',
            'public-ipv4' => '1172.16.58.3',
            'public-keys' => [
                    [
                            'keyname' => 'my-public-key',
                            'index' => '0',
                            'format' => 'openssh-key',
                            'key' => 'ssh-rsa hogefuga my-public-key'
                    ]
            ],
            'ramdisk-id' => 'ari-abcdefgh',
            'reservation-id' => 'r-1234abcd',
            'security-groups' => 'securitygroups',
            'user-data' => 'this is userdata'
    ];

    private $ec2metadata;

    public function setUp()
    {

        $this->ec2metadata = new \Aws\Mock\VirtualEc2Metadata($this->dummyMetadata);
    }

    /**
     * @test
     */
    public function getAmiLaunchIndexTest()
    {

        $this->assertEquals($this->ec2metadata->getAmiLaunchIndex(), '0');
    }

    /**
     * @test
     */
    public function getAmiManifestPathTest()
    {

        $this->assertEquals($this->ec2metadata->getAmiManifestPath(), '(unknown)');
    }

    /**
     * @test
     */
    public function getAncestorAmiIdsTest()
    {

        $this->assertEquals($this->ec2metadata->getAncestorAmiIds(), 'not available');
    }

    /**
     * @test
     */<commit_msg>ad getAmiId Test<commit_after><?php

namespace Aws\Tests;

class Ec2MetadataTest extends \PHPUnit_Framework_TestCase
{

    private $dummyMetadata = [
            'ami-id' => 'ami-12345678',
            'ami-launch-index' => '0',
            'ami-manifest-path' => '(unknown)',
            'block-device-mapping' => [
                    'ebs0' => 'sda',
                    'ephemeral0' => 'sdb',
                    'root' => '/dev/sda1'
            ],
            'hostname' => 'ip-10-123-123-123.ap-northeast-1.compute.internal',
            'instance-id' => 'i-87654321',
            'instance-type' => 't1.micro',
            'local-hostname' => 'ip-10-123-123-123.ap-northeast-1.compute.internal',
            'local-ipv4' => '10.123.123.123',
            'kernel-id' => 'aki-12345678',
            'placement' => 'ap-northeast-1c',
            'product-codes' => 'abcdefghijklmnopqrstuvwxy',
            'public-hostname' => 'ec2-12-34-56-78.ap-northeast-1.compute.amazonaws.com',
            'public-ipv4' => '172.16.17.32',
            'public-keys' => [
                    [
                            'keyname' => 'my-public-key',
                            'index' => '0',
                            'format' => 'openssh-key',
                            'key' => 'ssh-rsa hogefuga my-public-key'
                    ]
            ],
            'ramdisk-id' => 'ari-abcdefgh',
            'reservation-id' => 'r-1234abcd',
            'security-groups' => 'securitygroups',
            'user-data' => 'this is userdata'
    ];

    private $ec2metadata;

    public function setUp()
    {

        $this->ec2metadata = new \Aws\Mock\VirtualEc2Metadata($this->dummyMetadata);
    }

    /**
     * @test
     */
    public function getAmiIdTest()
    {

        $this->assertEquals($this->ec2metadata->getAmiId(), 'ami-12345678');
    }

    /**
     * @test
     */
    public function getAmiLaunchIndexTest()
    {

        $this->assertEquals($this->ec2metadata->getAmiLaunchIndex(), '0');
    }

    /**
     * @test
     */
    public function getAmiManifestPathTest()
    {

        $this->assertEquals($this->ec2metadata->getAmiManifestPath(), '(unknown)');
    }

    /**
     * @test
     */
    public function getAncestorAmiIdsTest()
    {

        $this->assertEquals($this->ec2metadata->getAncestorAmiIds(), 'not available');
    }

    /**
     * @test
     */
{'fraction_non_alphanumeric': 0.16868512110726644, 'fraction_numerical': 0.04476643598615917, 'mean_word_length': 1.5866890380313199, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 80, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3202552', 'n_tokens_mistral': 1615, 'n_tokens_neox': 1481, 'n_words': 190}